How to detect if building with address sanitizer when building with gcc 4.8? January 8, 2024 by Tarik From the GCC 4.8.0 manual: __SANITIZE_ADDRESS__ This macro is defined, with value 1, when -fsanitize=address is in use.