statement expressions and extended asm bug?

Segher Boessenkool segher@kernel.crashing.org
Fri Mar 19 15:58:00 GMT 2004


On 19-mrt-04, at 15:18, Segher Boessenkool wrote:

>
> On 19-mrt-04, at 14:53, Jamie Lokier wrote:
>
>> Hans-Peter Nilsson wrote:
>>> It's no stranger than "func (a++, a++)" being undefined.
>>
>> That's undefined.  This isn't undefined:
>>
>>     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.

Erm.  Well of course you return 0 in any case, so evaluation order
doesn't change the meaning of this example.  But it's invalid
code anyway, now that I took a second look at it ;-)


Segher



More information about the Gcc mailing list