From 79c8e26fa7d8bb3e3ab59e5a69ea37cc385748c0 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 6 Sep 2013 14:03:35 -0500 Subject: [svn-r24111] Description: Restrict GCC diagnostic pragmas to only gcc 4.6+ Tested on: Mac OSX/64 10.8.4 (amazon) w/gcc 4.8 --- src/H5private.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/H5private.h b/src/H5private.h index c376789..984f7da 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2359,20 +2359,15 @@ func_init_failed: \ * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas */ -/* These pragmas are only implemented in gcc 4.2+ */ -#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 +/* These pragmas are only implemented usefully in gcc 4.6+ */ +#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 #define GCC_DIAG_STR(s) #s #define GCC_DIAG_JOINSTR(x,y) GCC_DIAG_STR(x ## y) #define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) #define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x) - /* These pragmas are only implemented in gcc 4.6+ */ - #if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 - #define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x)) - #define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop) - #else - #define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x)) - #define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(warning GCC_DIAG_JOINSTR(-W,x)) - #endif + + #define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x)) + #define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop) #else #define GCC_DIAG_OFF(x) #define GCC_DIAG_ON(x) -- cgit v0.12