Possible wrong-code bug in GCC?

Jonathan Wakely jwakely.gcc@gmail.com
Tue Aug 2 06:35:43 GMT 2022


On Tue, 2 Aug 2022 at 05:45, Haoxin Tu via Gcc <gcc@gcc.gnu.org> wrote:
>
> Oh, sorry for the noise, there is an integer overflow that may cause
> undefined behavior.

You should check with UBsan before reporting something as a bug:

s.c:5:2: runtime error: signed integer overflow: 2147483647 + 1 cannot
be represented in type 'int'


More information about the Gcc mailing list