summaryrefslogtreecommitdiffstats
path: root/src/H5detect.c
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2018-07-16 15:39:13 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2018-07-16 15:39:13 (GMT)
commit643593dfda47f0dfe2159ae494a1f80142da3f4e (patch)
treea5f7c3beacc39ba3263da90b1653e96a9a4c5ed6 /src/H5detect.c
parentf649be9fdc9add7a12aa5c8290b9bf8a45d49a56 (diff)
parent5afeefe1bae62fa5faf06c0c6f240e10863a2693 (diff)
downloadhdf5-643593dfda47f0dfe2159ae494a1f80142da3f4e.zip
hdf5-643593dfda47f0dfe2159ae494a1f80142da3f4e.tar.gz
hdf5-643593dfda47f0dfe2159ae494a1f80142da3f4e.tar.bz2
Merge pull request #1112 in HDFFV/hdf5 from ~JSOUMAGNE/hdf5_fork:gcc_sanitize to develop
* commit '5afeefe1bae62fa5faf06c0c6f240e10863a2693': Fix H5detect to use no_sanitize_address attribute and support GCC sanitizers
Diffstat (limited to 'src/H5detect.c')
-rw-r--r--src/H5detect.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/H5detect.c b/src/H5detect.c
index 6ad45aa..60ef656 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;