Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!tgr!gwyn@Brl-Vld.ARPA From: gwyn@Brl-Vld.ARPA (VLD/VMB) Newsgroups: net.lang.c Subject: Re: C question Message-ID: <9858@brl-tgr.ARPA> Date: Wed, 10-Apr-85 13:01:38 EST Article-I.D.: brl-tgr.9858 Posted: Wed Apr 10 13:01:38 1985 Date-Received: Fri, 12-Apr-85 06:49:49 EST Sender: news@brl-tgr.ARPA Lines: 16 A more useful question might be, "What does the draft proposed ANSI C standard say about x = x++; ?" The X3J11 committee has attempted to deal with such issues by identifying what constitutes a "side effect" (post-increment is one) and when side effects must be enforced during execution (at "sequence points"). Assignment is NOT flagged as a sequence point; I don't know whether this was intentional but I suspect it was. The ";" of an expression-statement causes the expression to be evaluated for its side effects, though. The upshot is that the result is implementation-dependent. In general, one is asking for trouble any time he modifies AND uses an object in different places in the same expression, even if the behavior is supposed to be well-defined. I have yet to see a compiler that wouldn't break if pushed too hard.