[PATCH] compiler-gcc.h: don't set COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW for sparse

From: Miroslav Benes
Date: Fri Jun 08 2018 - 02:34:54 EST


sparse errors out with

./include/linux/overflow.h:254:13: error: undefined identifier '__builtin_mul_overflow'
./include/linux/overflow.h:254:13: error: incorrect type in conditional
./include/linux/overflow.h:254:13: got void
./include/linux/overflow.h:256:13: error: undefined identifier '__builtin_add_overflow'
./include/linux/overflow.h:256:13: error: incorrect type in conditional
./include/linux/overflow.h:256:13: got void

Sparse has not acquired generic overflow builtins yet, so don't set
COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW for it.

Signed-off-by: Miroslav Benes <mbenes@xxxxxxx>
Acked-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
---
include/linux/compiler-gcc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index f1a7492a5cc8..15e55b89e952 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -344,6 +344,6 @@
*/
#define uninitialized_var(x) x = x

-#if GCC_VERSION >= 50100
+#if GCC_VERSION >= 50100 && !defined(__CHECKER__)
#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
#endif
--
2.17.0