summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTERESH1 <svyatoslavtereshin@yandex.ru>2022-12-29 01:03:20 +0300
committerGitHub <noreply@github.com>2022-12-28 23:03:20 +0100
commit8e47e56c9d629d26dee7d949836e2b87dc219351 (patch)
treec030432bce85ed571c8e9252acdc6c88af9875e7
parent0025ae839102aabc167690db60b154970ec4de05 (diff)
downloadlibarchive-8e47e56c9d629d26dee7d949836e2b87dc219351.tar.gz
add "no sanitize undefined" attribute with clang (#1827)
Issue #1826
-rw-r--r--libarchive/xxhash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libarchive/xxhash.c b/libarchive/xxhash.c
index f96e9d93..beacd239 100644
--- a/libarchive/xxhash.c
+++ b/libarchive/xxhash.c
@@ -149,6 +149,10 @@ typedef struct _U32_S { U32 v; } _PACKED U32_S;
#if GCC_VERSION >= 409
__attribute__((__no_sanitize_undefined__))
+#else
+# if defined(__clang__)
+__attribute__((no_sanitize("undefined")))
+# endif
#endif
#if defined(_MSC_VER)
static __inline U32 A32(const void * x)