[Qt-creator] Use clang UBSan with QtC

Konstantin Tokarev annulen at yandex.ru
Sat Jun 4 19:34:58 CEST 2016



04.06.2016, 20:25, "Denis Shienkov" <denis.shienkov at gmail.com>:
>> If you use GCC-based kit, you will use GCC implementation of UBSan instead of Clang's (GCC >= 4.9 required)
>
> Ok, clear, I use GCC 5.xxx
>
>> UBSan is dynamic analysis tool, based on compiler instrumentation. It has nothing to do with static analysis.
>
> So, should I just run my app and see debug outputs?

Yes, it will crash in case UB is detected

>
> 2016-06-04 20:16 GMT+03:00 Konstantin Tokarev <annulen at yandex.ru>:
>> 04.06.2016, 20:07, "Denis Shienkov" <denis.shienkov at gmail.com>:
>>>> As with other sanitizers, just add -fsanitize=undefined to QMAKE_CXXFLAGS and QMAKE_LFLAGS
>>>
>>> 1. Should I use the Clang-based Kit and compile my sources with this Kit, or I can use GCC-based kit for this?
>>
>> If you use GCC-based kit, you will use GCC implementation of UBSan instead of Clang's (GCC >= 4.9 required)
>>
>>> 2. Is this will work when I click on "Analyze -> Clang Static Analyzer" from the QtC menu?
>>
>> UBSan is dynamic analysis tool, based on compiler instrumentation. It has nothing to do with static analysis.
>>
>>>
>>> 2016-06-04 19:39 GMT+03:00 Konstantin Tokarev <annulen at yandex.ru>:
>>>> 04.06.2016, 19:27, "Denis Shienkov" <denis.shienkov at gmail.com>:
>>>>> Hi all,
>>>>>
>>>>> 1) is it possible to use the clang's UBSan with QtC? :)
>>>>
>>>> Why not?
>>>>
>>>>>
>>>>> 2) if yes - then how to do it?
>>>>
>>>> As with other sanitizers, just add -fsanitize=undefined to QMAKE_CXXFLAGS and QMAKE_LFLAGS
>>>>
>>>>>
>>>>> 3) if yes - is it possible to use on Windows?
>>>>
>>>> http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#supported-platforms
>>>>
>>>>>
>>>>> BR,
>>>>>
>>>>> Denis
>>>>>
>>>>> _______________________________________________
>>>>> Qt-creator mailing list
>>>>> Qt-creator at qt-project.org
>>>>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>>>>
>>>> --
>>>> Regards,
>>>> Konstantin
>>
>> --
>> Regards,
>> Konstantin
> ,
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator


-- 
Regards,
Konstantin



More information about the Qt-creator mailing list