Re: [PATCH v4] gc: call "prune --expire 2.weeks.ago" by default
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Mar 13, 2008, 10:17 UTC
- Message-ID
- <47D8FF3B.9050304@viscovery.net>
- In-Reply-To
- <7FB80115-C1E4-4F83-9374-41AB1BDA0579@wincent.com>
Wincent Colaiuta schrieb:
Show 12 quoted lines
> El 13/3/2008, a las 0:39, Junio C Hamano escribió:
>> if (strcmp(value, "now")) {
>> unsigned long now = approxidate("now");
>> if (approxidate(value) >= now)
>> return error("Invalid %s: '%s'", var, value);
>> ...
>> }
>
>
> Are you sure that that alternative provides any guarantees about
> evaluation order either? (I'm not a compiler expert, nor am I consulting
> a copy of the standard; but I don't think it does.)There is a sequence point at the semicolon. This means that all observable side effects of approxidate("now") are visible when approxidate(value) is evaluated (and no observable side effect of the latter is visible when the former is evaluated), which doesn't leave much choice for the compiler. So, yes, this does guarantee the intended evaluation order.
-- Hannes