[cfe-users] Boost.GIL test failing with clang 5.x while pass with 15 gcc/clang versions
Mateusz Loskot via cfe-users
cfe-users at lists.llvm.org
Mon May 21 11:08:42 PDT 2018
On 21 May 2018 at 19:27, Jan Korous <jkorous at apple.com> wrote:
>
> You are hitting UB because of signed integer overflow.
> [...]
>
> BTW This is a perfect opportunity to try out UndefinedBehaviorSanitizer!
>
> https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
>
>> clang++ -fsanitize=signed-integer-overflow overflow.cpp
>> ./a.out
> -2147483648
> overflow.cpp:24:52: runtime error: signed integer overflow: 2147483647 - -2147483648 cannot be represented in type 'int'
Hi Jan,
This is very helpful indeed.
Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
More information about the cfe-users
mailing list