diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2018-06-15 21:47:32 (GMT) |
---|---|---|
committer | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2018-07-26 22:16:15 (GMT) |
commit | 1268499234d8d1954bdc6b2159d4679851f9bc74 (patch) | |
tree | 56ad1c88d40dcef59cdf4808d4c04f11bdf435a6 /src/H5detect.c | |
parent | 792b3352b979db82db59ecea0154e7fda82da8a4 (diff) | |
download | hdf5-1268499234d8d1954bdc6b2159d4679851f9bc74.zip hdf5-1268499234d8d1954bdc6b2159d4679851f9bc74.tar.gz hdf5-1268499234d8d1954bdc6b2159d4679851f9bc74.tar.bz2 |
Fix H5detect to use no_sanitize_address attribute and support GCC sanitizers
Diffstat (limited to 'src/H5detect.c')
-rw-r--r-- | src/H5detect.c | 12 |
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; |