lkml.org 
[lkml]   [2018]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: sparse warnings in overflow.h
On Thu, Jun 7, 2018 at 4:01 AM, Miroslav Benes <mbenes@suse.cz> wrote:
>
> Hi Kees,
>
> sparse (make C=1) gives me this warnings today...
>
> ./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
>
> This hunk obviously fixes it, but I'm really not sure if it is a proper
> fix.
>
> 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
>
> Any idea?

Hi! Yeah, that's probably the correct approach. If the checker doesn't
have it, the builtins need to be disabled. :)

Can you send this with a Signed-off-by line, etc, and I'll take it for
sending to Linus?

Thanks!

-Kees

--
Kees Cook
Pixel Security

\
 
 \ /
  Last update: 2018-06-07 20:35    [W:0.075 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site