Turning on address sanitizer in Xcode 7 passes the compile and linker flag -fsanitize=address
and also defines _LIBCPP_HAS_NO_ASAN
.
When building my library from the command line and running tests on a sanitized build without defining _LIBCPP_HAS_NO_ASAN
I see non-repeatable address-sanitizer-reported memory access issues. Defining _LIBCPP_HAS_NO_ASAN
, as Xcode does, gets rid of the sanitizer issues but I’m curious as to why it needs doing.
Why do I need to define _LIBCPP_HAS_NO_ASAN
with AppleClang7 to avoid getting memory access issues in libcxx?
Regards,
Jon