Thread (4 messages) flat view 4 messages, 4 authors, 2016-06-15

Re: [PATCH v4] gc: call "prune --expire 2.weeks.ago" by default

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:44:22

Wincent Colaiuta schrieb:
El 13/3/2008, a las 0:39, Junio C Hamano escribió:
quoted
         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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help