diff --git a/addr2line.c b/addr2line.c index 2f54c14162..1616ec9855 100644 --- a/addr2line.c +++ b/addr2line.c @@ -8,10 +8,14 @@ **********************************************************************/ -#if defined(__clang__) +#if defined(__clang__) && defined(__has_warning) +#if __has_warning("-Wgnu-empty-initializer") #pragma clang diagnostic ignored "-Wgnu-empty-initializer" +#endif +#if __has_warning("-Wgcc-compat") #pragma clang diagnostic ignored "-Wgcc-compat" #endif +#endif #include "ruby/internal/config.h" #include "ruby/defines.h"