Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.lang.c Subject: Re: Indirect comma assigned from side effects Message-ID: <3133@umcp-cs.UUCP> Date: Tue, 26-Aug-86 09:42:37 EDT Article-I.D.: umcp-cs.3133 Posted: Tue Aug 26 09:42:37 1986 Date-Received: Wed, 27-Aug-86 09:16:57 EDT References: <792@navajo.STANFORD.EDU> <3047@umcp-cs.UUCP> <796@navajo.STANFORD.EDU> <2401@ihlpg.UUCP> Reply-To: chris@umcp-cs.UUCP (Chris Torek) Organization: University of Maryland, Dept. of Computer Sci. Lines: 22 >>> foo() { *( index=lhs, pointers[index] ) = sideeffects(); } >>>... does C allow for the possibility that the order >>>of evaluation might be "index=lhs" then "sideeffects()" then >>>"*pointers[index]="? >In article <3047@umcp-cs.UUCP> I wrote: >>No. In article <2401@ihlpg.UUCP> tainter@ihlpg.UUCP (Tainter) writes: >As far as I can tell the only restriction on order of evaluation is >index=lhs before pointers[index]. After more thought, I now reverse myself. K&R (p. 192) say only `a pair of expressions separated by a comma is evaluated left-to- right and the value of the left expression is discarded.' Apparently this does not imply that nothing else may occur in between. I may see whether X3J11 is more explicit, but that must wait until I am once again near a copy of the latest draft. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu