Function Argument Evaluation
Doug Gwyn
gwyn at smoke.brl.mil
Wed Mar 27 08:56:24 AEST 1991
In article <1991Mar25.195234.7179 at sq.sq.com> msb at sq.sq.com (Mark Brader) writes:
-# Between the previous and next sequence point an object shall have
-# its stored value modified at most once by the evaluation of an
-# expression. Furthermore, the prior value shall be accessed only
-# to determine the value to be stored.
-...
-# If a "shall" or "shall not" requirement that appears outside of a
-# constraint is violated, the behavior is undefined.
OK, Mark may have found a justification for obtaining undefined behavior
out of the example program we've been discussing. This reason is separate
from the (incorrect) ones previously proposed.
In practice I would expect a well-defined result obtained by the
implementation applying a particular ordering to the unspecified
subexpression evaluation, but the program violation of a "shall"
would allow the implementation to behave randomly if it wanted to.
More information about the Comp.std.c
mailing list