How can I know if Leak Sanitizer is enabled at compile time?
问题 The GCC and Clang compilers both have support for LeakSanitizer which helps finding memory leaks in C programs. Sometimes a memory leak is unavoidable (because it is being tested in a test suite for example). Such memory can be annotated using the Leak Sanitizer interface: #include <sanitizer/lsan_interface.h> void *p = create_new_object(); __lsan_ignore_object(p); This will however break on compilers that do not support LSan. In Address Sanitizer, this construct can be used to detect the