statement expressions and extended asm bug?

Robert Dewar dewar@gnat.com
Sun Mar 21 08:49:00 GMT 2004


Segher Boessenkool wrote:

>>     static inline void increment (int * ptr) { *ptr++; return 0; }
>>     func (increment (&a), increment (&a));

> No, it is just as undefined.  The compiler is free to call
> either the "left" or the "right" increment() first.

Don't mix up undefined with well defined but non-deterministic
semantics. The function calls in such a case may indeed result
in a non-deterministic semantics (although in this particular
case they don't), but the result is well defined. But the
macro or explicit multiple increment is indeed undefined.
At least that's my understanding of current C semantics!




More information about the Gcc mailing list