sequence points

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Jun 29 01:58:43 AEST 1990


In article <103459 at convex.convex.com> grogers at convex.com (Geoffrey Rogers) writes:
>>	func1(<argument list>) + func2(<argument list>)
>The dp ANSI, Dec 89, page 42, states "The order of evaluation of the function
>designator, the arguments, and subexpressions within the arguments are 
>unspecified, but there is a sequence point before the actual call". This
>would lead me to believe that you can evaluate all of the arguments for
>both functions before calling either one.

The important point is that the + operator does not impose an order of
evaluation on its operands.  As you note, the arguments to a function
must be completely evaluated (including side effects) before the
function is called.  How much before is not specified, other than that
it must be after the previous sequence point.



More information about the Comp.std.c mailing list