diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2021-06-04 21:52:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-04 21:52:36 (GMT) |
commit | 9bf274e21a318b201a34b2d2e81a23f5c0bfecb2 (patch) | |
tree | 6d8ae99974342c63611cf7ae308da81c256fa46e /src | |
parent | 9041351328a4f0c806da56653c3c8abdda2ad222 (diff) | |
download | hdf5-9bf274e21a318b201a34b2d2e81a23f5c0bfecb2.zip hdf5-9bf274e21a318b201a34b2d2e81a23f5c0bfecb2.tar.gz hdf5-9bf274e21a318b201a34b2d2e81a23f5c0bfecb2.tar.bz2 |
Moves gcc warning macros from H5public.h to H5private.h (#724)
* Moves gcc warning suppression macros out of H5public.h
* Update RELEASE.txt
* Formatted source
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FDmulti.c | 27 | ||||
-rw-r--r-- | src/H5private.h | 23 | ||||
-rw-r--r-- | src/H5public.h | 32 |
3 files changed, 55 insertions, 27 deletions
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 97d1d7a..5562c23 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -45,6 +45,29 @@ #define my_strdup strdup #endif +/* Macros for enabling/disabling particular GCC warnings + * + * These are (renamed) duplicates of macros in H5private.h. If you make changes + * here, be sure to update those as well. + * + * (see the following web-sites for more info: + * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html + * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas + */ +/* These pragmas are only implemented usefully in gcc 4.6+ */ +#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 +#define H5_MULTI_GCC_DIAG_JOINSTR(x, y) x y +#define H5_MULTI_GCC_DIAG_DO_PRAGMA(x) _Pragma(#x) +#define H5_MULTI_GCC_DIAG_PRAGMA(x) H5_MULTI_GCC_DIAG_DO_PRAGMA(GCC diagnostic x) + +#define H5_MULTI_GCC_DIAG_OFF(x) \ + H5_MULTI_GCC_DIAG_PRAGMA(push) H5_MULTI_GCC_DIAG_PRAGMA(ignored H5_MULTI_GCC_DIAG_JOINSTR("-W", x)) +#define H5_MULTI_GCC_DIAG_ON(x) H5_MULTI_GCC_DIAG_PRAGMA(pop) +#else +#define H5_MULTI_GCC_DIAG_OFF(x) +#define H5_MULTI_GCC_DIAG_ON(x) +#endif + /* Loop through all mapped files */ #define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) \ { \ @@ -1959,7 +1982,7 @@ compute_next(H5FD_multi_t *file) * tmp in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF("format-nonliteral") +H5_MULTI_GCC_DIAG_OFF("format-nonliteral") static int open_members(H5FD_multi_t *file) { @@ -2044,7 +2067,7 @@ H5FD_multi_delete(const char *filename, hid_t fapl_id) return 0; } /* end H5FD_multi_delete() */ -H5_GCC_DIAG_ON("format-nonliteral") +H5_MULTI_GCC_DIAG_ON("format-nonliteral") #ifdef H5private_H /* diff --git a/src/H5private.h b/src/H5private.h index 9c2459a..a1285ee 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -558,6 +558,29 @@ typedef long int32_t; #define LOCK_UN 0x08 #endif /* H5_HAVE_FLOCK */ +/* Macros for enabling/disabling particular GCC warnings + * + * These are duplicated in H5FDmulti.c (we don't want to put them in the + * public header and the multi VFD can't use private headers). If you make + * changes here, be sure to update those as well. + * + * (see the following web-sites for more info: + * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html + * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas + */ +/* These pragmas are only implemented usefully in gcc 4.6+ */ +#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 +#define H5_GCC_DIAG_JOINSTR(x, y) x y +#define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma(#x) +#define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x) + +#define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR("-W", x)) +#define H5_GCC_DIAG_ON(x) H5_GCC_DIAG_PRAGMA(pop) +#else +#define H5_GCC_DIAG_OFF(x) +#define H5_GCC_DIAG_ON(x) +#endif + /* Typedefs and functions for timing certain parts of the library. */ /* A set of elapsed/user/system times emitted as a time point by the diff --git a/src/H5public.h b/src/H5public.h index b548889..bf81605 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -59,31 +59,6 @@ #endif #endif -/* Include the Windows API adapter header early */ -#include "H5api_adpt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Macros for enabling/disabling particular GCC warnings */ -/* (see the following web-sites for more info: - * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html - * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas - */ -/* These pragmas are only implemented usefully in gcc 4.6+ */ -#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 -#define H5_GCC_DIAG_JOINSTR(x, y) x y -#define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma(#x) -#define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x) - -#define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR("-W", x)) -#define H5_GCC_DIAG_ON(x) H5_GCC_DIAG_PRAGMA(pop) -#else -#define H5_GCC_DIAG_OFF(x) -#define H5_GCC_DIAG_ON(x) -#endif - /* Macro to hide a symbol from further preprocessor substitutions */ #define H5_NO_EXPAND(x) (x) @@ -368,6 +343,13 @@ typedef struct H5_alloc_stats_t { */ typedef void (*H5_atclose_func_t)(void *ctx); +/* API adapter header (defines H5_DLL, etc.) */ +#include "H5api_adpt.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* Functions in H5.c */ /** * \ingroup H5 |