summaryrefslogtreecommitdiffstats
path: root/src/H5detect.c
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2021-09-16 12:42:20 (GMT)
committerGitHub <noreply@github.com>2021-09-16 12:42:20 (GMT)
commit1f2bba5255014465a319750e2ba712ebb70eee74 (patch)
treec87689592004808410b589cee3b4740259535486 /src/H5detect.c
parent1c892fb41fb5439d3b4a69fd3cd9d25e4aa2ee6e (diff)
downloadhdf5-1f2bba5255014465a319750e2ba712ebb70eee74.zip
hdf5-1f2bba5255014465a319750e2ba712ebb70eee74.tar.gz
hdf5-1f2bba5255014465a319750e2ba712ebb70eee74.tar.bz2
Modified gcc/clang warning suppression macros to account for some warnings flags being supported by one compiler but not the other (#379)
* Committing clang-format changes * Fixed GCC warning suppression pragmas to also work with clang H5_GCC_DIAG_ON remains gcc-only. Added a new H5_CLANG_DIAG_ON that's clang-only, but it's not used anywhere currently. Added a new H5_GCC_CLANG_DIAG_ON that works with both compilers, which afterall support mostly the same warnings. Changed almost all uses of H5_GCC_DIAG_ON to use H5_GCC_CLANG_DIAG_ON, with the exception of a couple, where they really were suppressing gcc-only warnings. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5detect.c')
-rw-r--r--src/H5detect.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/H5detect.c b/src/H5detect.c
index 2e893cf..e8cded7 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -52,7 +52,7 @@ static const char *FileHeader = "\n\
/* Disable warning about cast increasing the alignment of the target type,
* that's _exactly_ what this code is probing. -QAK
*/
-H5_GCC_DIAG_OFF("cast-align")
+H5_GCC_CLANG_DIAG_OFF("cast-align")
#if defined(__has_attribute)
#if __has_attribute(no_sanitize_address)
@@ -300,10 +300,10 @@ precision(detected_t *d)
for (_byte_mask = (unsigned char)1; _byte_mask; _byte_mask = (unsigned char)(_byte_mask << 1)) { \
_buf1[_i] ^= _byte_mask; \
HDmemcpy((void *)&_v2, (const void *)_buf1, sizeof(TYPE)); \
- H5_GCC_DIAG_OFF("float-equal") \
+ H5_GCC_CLANG_DIAG_OFF("float-equal") \
if (_v1 != _v2) \
_pad_mask[_i] |= _byte_mask; \
- H5_GCC_DIAG_ON("float-equal") \
+ H5_GCC_CLANG_DIAG_ON("float-equal") \
_buf1[_i] ^= _byte_mask; \
} /* end for */ \
\
@@ -414,10 +414,10 @@ precision(detected_t *d)
HDmemcpy(_buf + align_g[_ano] + (INFO.offset / 8), ((char *)&_val) + (INFO.offset / 8), \
(size_t)(INFO.precision / 8)); \
_val2 = *((TYPE *)(_buf + align_g[_ano])); \
- H5_GCC_DIAG_OFF("float-equal") \
+ H5_GCC_CLANG_DIAG_OFF("float-equal") \
if (_val != _val2) \
H5LONGJMP(jbuf_g, 1); \
- H5_GCC_DIAG_ON("float-equal") \
+ H5_GCC_CLANG_DIAG_ON("float-equal") \
/* End Cray Check */ \
(INFO.align) = align_g[_ano]; \
} \
@@ -1567,4 +1567,4 @@ main(int argc, char *argv[])
return EXIT_SUCCESS;
}
-H5_GCC_DIAG_ON("cast-align")
+H5_GCC_CLANG_DIAG_ON("cast-align")