From: utzoo!decvax!harpo!ihnp4!iwsl1!deg
Newsgroups: net.lang.c
Title: Re: Theory of Pure C, chapter 937
Article-I.D.: iwsl1.106
Posted: Thu Jan  6 12:21:05 1983
Received: Fri Jan  7 02:44:24 1983
References: hssg40.257 we53.169

Problem:
 foo( x++ * x )

Data: (according to "The C Programming Language" K&R)
 p. 185: "expressions involving a commutative and associative
	operator ( *,+,&,|,^) may be rearranged arbitrarily by the
	compiler."
	so the x++ may be evaluated before or after the other x

 p. 187: "[for postfix ++] After the value is noted, the III) evaluate x (second x)
     evaluate x (first x)
     pass value of X*X to function
     after function returns store X+1 in x
     (if foo changes x, the change is lost)
     (This would require a bizzare compiler, but, I think, is legal)

I think all other possible linearizations produce one of the
above results.

David Good
(iwsl1!deg)