[Bug sanitizer/82072] sanitizer does not detect an overflow from LLONG_MIN

zeccav at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Sep 1 22:21:00 GMT 2017


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

--- Comment #9 from Vittorio Zecca <zeccav at gmail dot com> ---
Applying the proposed fix and compiling the test case with
-fsanitize=undefined I get

testcase.c:8:3: runtime error: signed integer overflow: 0 -
-9223372036854775808 cannot be represented in type 'long int'
testcase.c:9:5: runtime error: negation of -9223372036854775808 cannot
be represented in type 'long int'; cast to an unsigned type to negate
this value to itself

as it should be.


More information about the Gcc-bugs mailing list