statement expressions and extended asm bug?

Jamie Lokier jamie@shareable.org
Fri Mar 19 15:30:00 GMT 2004


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));

I'm not sure where this is defined or not, or whether it should be:

    #define increment(ptr) ({ *(ptr)++; 0; })
    func (increment (&a), increment (&a));

-- Jamie



More information about the Gcc mailing list