Evaluation of if's

Jonathan Gingerich jon at maui.cs.ucla.edu
Sat Jun 8 09:21:19 AEST 1991


Having raised exactly this subject several months ago, let me point out
that both sides are making valid points.  There are two distinct things
going on:

1. The description of the value of an assignment expression is sufficiently
   ambiguous in both K&RI and ANSI as to make the variability of
	((i=1)==(i=2))
   a reasonable question.  This is not directly answered in the FAQ.  It is
   not a `order of evaluation' question. It is not obvious.

2. There is no question that there is a rule in ANSI only, which says that
   expression which access the same location more than once are undefined.
   The above expression is undefined as is any other expression (to the
   best of my knowledge) that would illustrate a difference in the evaluation
   of an assignment expression.

Jon.



More information about the Comp.lang.c mailing list