How to detect Address Sanitizer is on

I'm trying to use

#if hasFeature(ADDRESS_SANITIZER)

#endif

But it doesn't work.

Is there a way with a precompile directive to check if the Address Sanitizer is active?

Have you tried this spelling instead?

#if __has_feature(address_sanitizer)

— Ed Ford,  DTS Engineer

How to detect Address Sanitizer is on
 
 
Q