Path: utzoo!utgpu!watmath!clyde!att!rutgers!deimos!uxc!tank!mimsy!chris
From: chris@mimsy.UUCP (Chris Torek)
Newsgroups: comp.lang.c
Subject: Re: side effects in argument lists
Message-ID: <14833@mimsy.UUCP>
Date: 3 Dec 88 17:39:02 GMT
References: <1077@mina.liu.se> <14758@mimsy.UUCP> <2916@arcturus>
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 20

In article <2916@arcturus> evil@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@mimsy.umd.edu	Path:	uunet!mimsy!chris