bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Arithmetic expression: evaluation order bug


From: Andreas Schwab
Subject: Re: Arithmetic expression: evaluation order bug
Date: Thu, 29 Dec 2022 23:15:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

On Dez 29 2022, Alain D D Williams wrote:

> On Thu, Dec 29, 2022 at 10:30:09PM +0100, Steffen Nurpmeso wrote:
>
>> only clang warns on sequencing when tested.
>
> Ah: so only clang gives the warning that the others should probably give.

$ gcc -Wall t.c
t.c: In function ‘main’:
t.c:7:11: warning: operation on ‘i’ may be undefined [-Wsequence-point]
         i += j += i += j;
           ^~
t.c:11:11: warning: operation on ‘i’ may be undefined [-Wsequence-point]
         i += j += i += i;
           ^~

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]