2018-02-16 17:33:15

by Luc Van Oostenryck

[permalink] [raw]
Subject: [PATCH] disable sparse warnings about unknown attributes

Currently, sparse issues warnings on code using an attribute
it doesn't know about.

One of the problem with this is that these warnings have no
value for the developer, it's just noise for him. At best these
warnings tell something about some deficiencies of sparse itself
but not about a potential problem with code analyzed.

A second problem with this is that sparse release are, alas,
less frequent than new attributes are added to GCC.

So, avoid the noise by asking sparse to not warn about
attributes it doesn't know about.

Reference: https://marc.info/?l=linux-sparse&m=151871600016790
Reference: https://marc.info/?l=linux-sparse&m=151871725417322
Signed-off-by: Luc Van Oostenryck <[email protected]>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 79ad2bfa2..8d9a7374c 100644
--- a/Makefile
+++ b/Makefile
@@ -388,7 +388,7 @@ PYTHON = python
CHECK = sparse

CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
- -Wbitwise -Wno-return-void $(CF)
+ -Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
NOSTDINC_FLAGS =
CFLAGS_MODULE =
AFLAGS_MODULE =
--
2.16.0



2018-02-16 18:21:32

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH] disable sparse warnings about unknown attributes

On 02/15/2018 01:07 PM, Luc Van Oostenryck wrote:
> Currently, sparse issues warnings on code using an attribute
> it doesn't know about.
>
> One of the problem with this is that these warnings have no
> value for the developer, it's just noise for him. At best these
> warnings tell something about some deficiencies of sparse itself
> but not about a potential problem with code analyzed.
>
> A second problem with this is that sparse release are, alas,
> less frequent than new attributes are added to GCC.
>
> So, avoid the noise by asking sparse to not warn about
> attributes it doesn't know about.
>
> Reference: https://marc.info/?l=linux-sparse&m=151871600016790
> Reference: https://marc.info/?l=linux-sparse&m=151871725417322
> Signed-off-by: Luc Van Oostenryck <[email protected]>
> ---
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 79ad2bfa2..8d9a7374c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -388,7 +388,7 @@ PYTHON = python
> CHECK = sparse
>
> CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
> - -Wbitwise -Wno-return-void $(CF)
> + -Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
> NOSTDINC_FLAGS =
> CFLAGS_MODULE =
> AFLAGS_MODULE =
>

Acked-by: Randy Dunlap <[email protected]>
Tested-by: Randy Dunlap <[email protected]>

thanks,
--
~Randy

2018-02-20 14:53:16

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] disable sparse warnings about unknown attributes

2018-02-16 6:07 GMT+09:00 Luc Van Oostenryck <[email protected]>:
> Currently, sparse issues warnings on code using an attribute
> it doesn't know about.
>
> One of the problem with this is that these warnings have no
> value for the developer, it's just noise for him. At best these
> warnings tell something about some deficiencies of sparse itself
> but not about a potential problem with code analyzed.
>
> A second problem with this is that sparse release are, alas,
> less frequent than new attributes are added to GCC.
>
> So, avoid the noise by asking sparse to not warn about
> attributes it doesn't know about.
>
> Reference: https://marc.info/?l=linux-sparse&m=151871600016790
> Reference: https://marc.info/?l=linux-sparse&m=151871725417322
> Signed-off-by: Luc Van Oostenryck <[email protected]>
> ---
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Applied to linux-kbuild/kbuild.

Thanks!


--
Best Regards
Masahiro Yamada