https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107405

--- Comment #4 from Jiri Slaby <jirislaby at gmail dot com> ---
(In reply to Martin Liška from comment #3)
> > enum { A = 0xffffffff, B = 1 << 31, };
> > int main() { printf("%lx %x %zu\n", A, B, sizeof(B)); }
> > 
> 
> Apparently, 0xffffffff is treated by the compiler as unsigned int constant
> and thus it likely leads to the promotion to a longer interger.

The problem is that is breaks existing code (which will be barely fixed as this
is clearly gcc-13's bug (or change of behavior at least)).

Another question is why B is affected by A at all? Also sizeof of that enum (if
one gives it a name) is 8 with gcc-13. That is not allowed by the standard,
IMO.

Reply via email to