In article <68nqmmF2u7p59U1@[EMAIL PROTECTED]
>, bop@[EMAIL PROTECTED]
says...
[ ... ]
> > 1: Though it's open to some question. $1.9/8 says: "Once the
> > execution of a function begins, no expressions from the calling
> > function are evaluated until execution of the called function has
> > completed."
> >
> > I'm interpreting evaluating the arguments to a function as part of
> > execution of the function. If you choose to interpret it as a
> > completely separate act that happens before the function's
> > execution, then you're right -- no ordering is defined. At least in
> > this case, it doesn't make any real difference though -- the
> > overall result is undefined behavior either way.
>
> I think your second interpretation is the correct one. It means that
> ++i can be evalueated before or after calling f, but not during.
You could _certainly_ be right. As I said, in this case it doesn't
really make much difference, since either one gives undefined results.
I got curious and read through N2284, and found that the wording has
been changed to [intro.execution]/16:
Every evaluation in the calling function (including other
function calls) that is not otherwise specifically
sequenced before or after the execution of the body of
the called function is indeterminately sequenced with
respect to the execution of the called function.
This is apparently an attempt at clarifying the situation, but doesn't
seem (to me) to add much clarity. In particular, it specifically cites
execution of the body of the function in one place, but execution of the
called function in the other. It's not at all clear whether this is just
mildly sloppy wording, and the two are intended to be synonymous, or
whether it's completely intentional, and intended to delineate between
the two.
--
Later,
Jerry.
The universe is a figment of its own imagination.


|