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

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
But why is that better than GCC's alternative, just defining macros like
__SANITIZE_ADDRESS__ and __SANITIZE_THREAD__?

Libstdc++ does this:

// Macro indicating that TSAN is in use.
#if __SANITIZE_THREAD__
#  define _GLIBCXX_TSAN 1
#elif defined __has_feature
# if __has_feature(thread_sanitizer)
#  define _GLIBCXX_TSAN 1
# endif
#endif

ISTM that it would be simpler if clang defined those macros too, because
checking for both __has_feature and then using __has_feature takes more work
than just checking a macro.

There's currently no macro for UBsan AFAIK, but one could be added.

Reply via email to