]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib/macros.h - protect old compilers from use of modern features
authorPhil Carmody <phil@dovecot.fi>
Mon, 5 Dec 2016 15:29:08 +0000 (17:29 +0200)
committerPhil Carmody <phil@dovecot.fi>
Mon, 5 Dec 2016 15:29:08 +0000 (17:29 +0200)
no_sanitize(integer) is not in 3.5 (debian stable's version), but is
documented in 3.9. Exactly when it appeared isn't immediately obvious.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
src/lib/macros.h

index adfaea9118cad6b7df0136185b01b8c61c779e73..c585489a4d0f783867bfa13d161ae8452218b153 100644 (file)
 #  define likely(expr) expr
 #endif
 
-#if defined(__clang__)
+#if defined(__clang__) && ((__clang_major__ > 4) || (__clang_major__ == 3 && __clang_minor__ >= 9))
 #  define ATTR_UNSIGNED_WRAPS __attribute__((no_sanitize("integer")))
 #else
 #  define ATTR_UNSIGNED_WRAPS