From 24418177080bb5e53243e5b1ded6bf9e54d271ab Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 21 Jul 2015 19:02:11 -0400 Subject: [PATCH] Improved comment for GCC_DIAGNOSTIC_AWARE --- misc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc.h b/misc.h index df04ce6d..cb1eb67f 100644 --- a/misc.h +++ b/misc.h @@ -44,6 +44,10 @@ // Used to supress some warnings in some header and implementation files. // Some platforms, like CentOS and OpenBSD, use old compilers that don't understand -Wno-unknown-pragma. +// These diagnostic blocks showed up somewhere between GCC 4.1 and 4.2, but 4.4 gets us semi-modern compilers. +// It seems using diagnostic blocks to manage warnings is semi-broken for GCC. Just leave it in place because +// GCC_DIAGNOSTIC_AWARE will help silence some warnings under GCC, and Clang responds to it as expected. +// (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431). #define GCC_DIAGNOSTIC_AWARE ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) || defined(__clang__)) // Used to manage function-level optimizations when working around compiler issues.