I forget what it was originally called.

Mike McNelly mike at hpfclq.HP.COM
Tue Mar 8 02:21:36 AEST 1988


Not only do different types cause changes in the order of evaluation,
but different classes may also cause differences.  C compilers make
choices on the order of evaluation based on the "cost" of evaluating a
subexpression.  Pcc compilers typically evaluate a a subexpression with
a high cost in register resources first.

As a specific example, you may find your expression compiled differently
if "i" is declared to be a register variable than if it was an auto or a
static.

Frankly I have little sympathy with anyone writing code in this manner.
It's cute but it's also no more efficient than alternatives that do what
you really wanted to do in a much less ambiguous fashion.  If you
inherited this code you have my condolences.



Mike McNelly
hplabs!hpfcla!mike



More information about the Comp.lang.c mailing list