side effects in argument lists
Chris Torek
chris at mimsy.UUCP
Sun Dec 4 03:39:02 AEST 1988
In article <2916 at arcturus> evil at arcturus.UUCP (Wade Guthrie) writes:
>I believe that binary operators such as '-' are also [dpANS] `sequence points'.
No, none of +, -, *, /, or % introduce a sequence point.
>Doesn't this cause the behavior of:
>
> a = b++ - b++;
>
>to be undefined (different answers depending on right-to-left evaluation
>versus left-to-right)?
You must be confused about sequence points. The order of evaluation of
objects on the left and right sides of the arithmetic operators listed
above is undefined. The *only* purpose for a sequence point is to
guarantee side effects, so a sequence point within an operation whose
evaluation order is undefined would be, er, `pointless'.
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain: chris at mimsy.umd.edu Path: uunet!mimsy!chris
More information about the Comp.lang.c
mailing list