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?


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


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