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?


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!



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