On 18/05/16 20:39, Yuri Gribov wrote:
On Wed, May 18, 2016 at 8:33 PM, Maxim Ostapenko
<m.ostape...@samsung.com> wrote:
Hi,

when compiling with -fsanitize=address we define __SANITIZE_ADDRESS__
macros, but we don't do this for -fsanitize=thread and -fsanitize=undefined.
Perhaps we should be more symmetric here and define corresponding
__SANITIZE_THREAD__ and __SANITIZE_UNDEFINED__ macros respectively?
Are these available in Clang as well?

AFAIK Clang has __has_feature(address_sanitizer) and __has_feature(thread_sanitizer). UBSan doesn't have such things.


I added two simple test cases to c-c++-common/{ub, t}san/ directories that
just verify if __SANITIZE_THREAD__ (__SANITIZE_UNDEFINED__) is defined. Is
that a proper way how we check that the macros defined correctly? Does this
patch looks reasonable?

-Maxim


Reply via email to