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: Steffen Nurpmeso
Subject: Re: Arithmetic expression: evaluation order bug
Date: Fri, 30 Dec 2022 00:12:36 +0100
User-agent: s-nail v14.9.24-383-g2889cb06b9

Andreas Schwab wrote in
 <87358xambe.fsf@igel.home>:
 |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

Sorry, that (-Wall) not.

 |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;
 |           ^~

Luckily it is not in real life.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



reply via email to

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