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

Dimitar Dimitrov <dimitar at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dimitar at gcc dot gnu.org

--- Comment #1 from Dimitar Dimitrov <dimitar at gcc dot gnu.org> ---
Pass the -Wstrict-overflow=4 option to GCC and see that compiler assumes no
integer overlow will happen:

test.c:3:12: warning: assuming signed overflow does not occur when simplifying
'X - Y <= 0' to 'X <= Y' [-Wstrict-overflow]
    3 |   return (x-y <= 0);


Consider using "__builtin_sub_overflow" for a strictly defined behaviour when
integer overflow happens.

Reply via email to