Merge tag 'compiler-attributes-for-linus-4.20-rc1' of https://github.com/ojeda/linux
[sfrench/cifs-2.6.git] / include / linux / compiler-gcc.h
index 2010493e1040846c999804e2e157233c27ccef60..c0f5db3a962174953a0e8bf19873b7a22334448d 100644 (file)
 #define KASAN_ABI_VERSION 3
 #endif
 
+/*
+ * Because __no_sanitize_address conflicts with inlining:
+ *   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
+ * we do one or the other. 
+ */
+#ifdef CONFIG_KASAN
+#define __no_sanitize_address_or_inline                                        \
+       __no_sanitize_address __maybe_unused notrace
+#else
+#define __no_sanitize_address_or_inline inline
+#endif
+
 #if GCC_VERSION >= 50100
 #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
 #endif