aboutsummaryrefslogtreecommitdiff
path: root/vpx_ports/compiler_attributes.h
diff options
context:
space:
mode:
Diffstat (limited to 'vpx_ports/compiler_attributes.h')
-rw-r--r--vpx_ports/compiler_attributes.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/vpx_ports/compiler_attributes.h b/vpx_ports/compiler_attributes.h
index 354352016..4b468749b 100644
--- a/vpx_ports/compiler_attributes.h
+++ b/vpx_ports/compiler_attributes.h
@@ -29,13 +29,23 @@
#endif // __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
#if defined(__clang__) && __has_attribute(no_sanitize)
+// Both of these have defined behavior and are used in certain operations or
+// optimizations thereof. There are cases where an overflow may be unintended,
+// however, so use of these attributes should be done with care.
#define VPX_NO_UNSIGNED_OVERFLOW_CHECK \
__attribute__((no_sanitize("unsigned-integer-overflow")))
-#endif
+#if __clang_major__ >= 12
+#define VPX_NO_UNSIGNED_SHIFT_CHECK \
+ __attribute__((no_sanitize("unsigned-shift-base")))
+#endif // __clang__ >= 12
+#endif // __clang__
#ifndef VPX_NO_UNSIGNED_OVERFLOW_CHECK
#define VPX_NO_UNSIGNED_OVERFLOW_CHECK
#endif
+#ifndef VPX_NO_UNSIGNED_SHIFT_CHECK
+#define VPX_NO_UNSIGNED_SHIFT_CHECK
+#endif
//------------------------------------------------------------------------------
// Variable attributes.