summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2018-06-15 21:47:32 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2018-06-15 21:49:54 (GMT)
commit5afeefe1bae62fa5faf06c0c6f240e10863a2693 (patch)
treed6dcb227e99868ac9c9f334edc3164f41bd71ee1
parentf62969a76ae019cc5109a0d8c7c5b48b8cb95080 (diff)
downloadhdf5-5afeefe1bae62fa5faf06c0c6f240e10863a2693.zip
hdf5-5afeefe1bae62fa5faf06c0c6f240e10863a2693.tar.gz
hdf5-5afeefe1bae62fa5faf06c0c6f240e10863a2693.tar.bz2
Fix H5detect to use no_sanitize_address attribute and support GCC sanitizers
-rw-r--r--src/H5detect.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/H5detect.c b/src/H5detect.c
index 1c5554e..69e07fd 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -54,12 +54,8 @@ static const char *FileHeader = "\n\
#include "H5Tpublic.h"
#include "H5Rpublic.h"
-#if defined(__has_attribute)
-#if __has_attribute(no_sanitize)
-#define HDF_NO_UBSAN __attribute__((no_sanitize("undefined")))
-#else
-#define HDF_NO_UBSAN
-#endif
+#if defined(__has_attribute) && __has_attribute(no_sanitize_address)
+#define HDF_NO_UBSAN __attribute__((no_sanitize_address))
#else
#define HDF_NO_UBSAN
#endif
@@ -1675,11 +1671,13 @@ detect_alignments(void)
*/
static int verify_signal_handlers(int signum, void (*handler)(int))
{
-#if defined(__has_feature)
+#if defined(__has_feature) /* Clang */
#if __has_feature(address_sanitizer) || __has_feature(thread_sanitizer)
/* Under the address and thread sanitizers, don't raise any signals. */
return 0;
#endif
+#elif defined(__SANITIZE_ADDRESS__) || defined(__SANITIZE_THREAD__) /* GCC */
+ return 0;
#endif
void (*save_handler)(int) = HDsignal(signum, handler);
volatile int i, val;