diff --git a/programs/fileio.c b/programs/fileio.c index 8b1e9f2f2..a2d5af2c4 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -20,6 +20,14 @@ # define _POSIX_SOURCE 1 /* disable %llu warnings with MinGW on Windows */ #endif +#if defined(__has_feature) && !defined(BACKTRACE_ENABLE) /* Clang compiler */ +# if (__has_feature(address_sanitizer)) +# define BACKTRACE_ENABLE 0 +# endif /* __has_feature(address_sanitizer) */ +#elif defined(__SANITIZE_ADDRESS__) && !defined(BACKTRACE_ENABLE) /* GCC compiler */ +# define BACKTRACE_ENABLE 0 +#endif + #if !defined(BACKTRACE_ENABLE) \ && ((defined(__linux__) && defined(__GLIBC__)) \ || (defined(__APPLE__) && defined(__MACH__)) )