Can analysis detect undefined expressions?

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Fri Jun 21 09:40:08 AEST 1991


In article <WORLEY.91Jun18095521 at sn1987a.compass.com> worley at compass.com (Dale Worley) writes:
  [ on statements like (i = 1) == (i = 2) ]
> The effect of this
> statement is "undefined", which means that the implementation can do
> *anything*, including giving i the value 100, core dumping, or
> starting World War III.

More realistically, there do exist architectures where parts of the
first assignment can overlap parts of the second. Think about core
memories: to read a bit you have to flip a bit, and the operations don't
commute. You just can't access the same word twice in one cycle.
Otherwise both the word and the value you read from it can be corrupted.
Vector machines, such as the Convex, continue this fine tradition.

---Dan



More information about the Comp.lang.c mailing list