This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: statement expressions and extended asm bug?



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]