address of register variables

fieland at hobbiton.prime.com fieland at hobbiton.prime.com
Sat Sep 9 06:56:00 AEST 1989


This problem has nothing to do with i being a register variable.
The order of evaluation of the assignment and the increment of i
in line 11 is undefined.  The Sun compiler has done the
assignment first when i is a register variable, and the
increment first when it is not.  

This differs from compiler to compiler.  The Mips compiler seems
to always do the assignment first.


Lint will very nicely print a warning about undefined evaluation
order when you run it on this program.


Peggy



More information about the Comp.lang.c mailing list