From: Johannes Berg <johannes.berg@xxxxxxxxx> Subject: compiler-gcc: hide COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW from sparse Sparse doesn't support all the overflow builtins, so just hide them from it to avoid lots of warnings/errors reported by it. We could try to teach them to sparse, but the passed types are variable, and sparse doesn't seem to handle that well. Link: http://lkml.kernel.org/r/20181109093534.15121-1-johannes@xxxxxxxxxxxxxxxx Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/include/linux/compiler-gcc.h~compiler-gcc-hide-compiler_has_generic_builtin_overflow-from-sparse +++ a/include/linux/compiler-gcc.h @@ -143,7 +143,7 @@ #define KASAN_ABI_VERSION 3 #endif -#if GCC_VERSION >= 50100 +#if GCC_VERSION >= 50100 && !defined(__CHECKER__) #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 #endif _