This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/82072] sanitizer does not detect an overflow from LLONG_MIN
- From: "zeccav at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 01 Sep 2017 22:21:50 +0000
- Subject: [Bug sanitizer/82072] sanitizer does not detect an overflow from LLONG_MIN
- Auto-submitted: auto-generated
- References: <bug-82072-4@http.gcc.gnu.org/bugzilla/>
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.