[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:11:50 PDT 2018


On 21 May 2018 at 20:08, Mateusz Loskot <mateusz at loskot.net> wrote:
> 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.

Jan, thank you very much!

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net



More information about the cfe-users mailing list