com php-src: hash: murmur: Suppress sanitize warnings under GCC: ext/hash/murmur/endianness.h
| From: | Anatol Belski | Date: | Sun, 01 Nov 2020 20:22:03 +0000 |
| Subject: | com php-src: hash: murmur: Suppress sanitize warnings under GCC: ext/hash/murmur/endianness.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-114009@lists.php.net to get a copy of this message | ||
Commit: 58e71efe7c88cb1662c600123172168e50ff8d2b
Author: Anatol Belski <ab@php.net> Sun, 1 Nov 2020 21:20:55 +0100
Parents: c3a6debc08ebdc1cc336eb2d13aae1988ccbe688
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=58e71efe7c88cb1662c600123172168e50ff8d2b
Log:
hash: murmur: Suppress sanitize warnings under GCC
Signed-off-by: Anatol Belski <ab@php.net>
Changed paths:
M ext/hash/murmur/endianness.h
Diff:
diff --git a/ext/hash/murmur/endianness.h b/ext/hash/murmur/endianness.h
index 23e6fb5a723..fd971a383ab 100644
--- a/ext/hash/murmur/endianness.h
+++ b/ext/hash/murmur/endianness.h
@@ -55,9 +55,13 @@ FORCE_INLINE uint64_t BSWAP64(uint64_t u)
}
#endif
-#ifdef __clang__
-__attribute__((no_sanitize("alignment")))
+#if defined(__clang__) || defined(__GNUC__) && ( __GNUC__ > 4 || __GNUC__ == 4
&& __GNUC_MINOR__ >= 8)
+# define NO_SANITIZE_ALIGNMENT __attribute__((no_sanitize("alignment")))
+#else
+# define NO_SANITIZE_ALIGNMENT
#endif
+
+NO_SANITIZE_ALIGNMENT
FORCE_INLINE uint32_t getblock32 ( const uint32_t * const p, const int i)
{
if (IsBigEndian()) {
@@ -67,9 +71,7 @@ FORCE_INLINE uint32_t getblock32 ( const uint32_t * const p, const int i)
}
}
-#ifdef __clang__
-__attribute__((no_sanitize("alignment")))
-#endif
+NO_SANITIZE_ALIGNMENT
FORCE_INLINE uint64_t getblock64 ( const uint64_t * const p, const int i)
{
if (IsBigEndian()) {
@@ -78,3 +80,5 @@ FORCE_INLINE uint64_t getblock64 ( const uint64_t * const p, const int i)
return p[i];
}
}
+
+#undef NO_SANITIZE_ALIGNMENT