[2/2] build: remove warnings for builds with icc
diff mbox series

Message ID 20200124153755.13939-3-bruce.richardson@intel.com
State Accepted
Delegated to: Thomas Monjalon
Headers show
Series
  • remove compiler warnings with icc using meson
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Jan. 24, 2020, 3:37 p.m. UTC
While icc builds without the "werror" setting build successfully, there are
a lot of warnings. To make the output cleaner, and to allow building with
warnings enabled, we can add a list of warning ids to ignore.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Burakov, Anatoly Jan. 24, 2020, 3:51 p.m. UTC | #1
On 24-Jan-20 3:37 PM, Bruce Richardson wrote:
> While icc builds without the "werror" setting build successfully, there are
> a lot of warnings. To make the output cleaner, and to allow building with
> warnings enabled, we can add a list of warning ids to ignore.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>   config/meson.build | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/config/meson.build b/config/meson.build
> index 28a57f56f..6c46767e3 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -197,6 +197,12 @@ if not dpdk_conf.get('RTE_ARCH_64')
>   # for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!!
>   	warning_flags += '-Wno-pointer-to-int-cast'
>   endif
> +if cc.get_id() == 'intel'
> +	warning_ids = [188, 2203, 2279, 2557, 3179, 3656]

Maybe worth it to add short warning descriptions in comments? e.g.

# 188: unused blah
# 2203: wrong foo

> +	foreach i:warning_ids
> +		warning_flags += '-diag-disable=@0@'.format(i)
> +	endforeach
> +endif
>   foreach arg: warning_flags
>   	if cc.has_argument(arg)
>   		add_project_arguments(arg, language: 'c')
>
Bruce Richardson Jan. 24, 2020, 4:34 p.m. UTC | #2
On Fri, Jan 24, 2020 at 03:51:16PM +0000, Burakov, Anatoly wrote:
> On 24-Jan-20 3:37 PM, Bruce Richardson wrote:
> > While icc builds without the "werror" setting build successfully, there are
> > a lot of warnings. To make the output cleaner, and to allow building with
> > warnings enabled, we can add a list of warning ids to ignore.
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >   config/meson.build | 6 ++++++
> >   1 file changed, 6 insertions(+)
> > 
> > diff --git a/config/meson.build b/config/meson.build
> > index 28a57f56f..6c46767e3 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -197,6 +197,12 @@ if not dpdk_conf.get('RTE_ARCH_64')
> >   # for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!!
> >   	warning_flags += '-Wno-pointer-to-int-cast'
> >   endif
> > +if cc.get_id() == 'intel'
> > +	warning_ids = [188, 2203, 2279, 2557, 3179, 3656]
> 
> Maybe worth it to add short warning descriptions in comments? e.g.
> 
> # 188: unused blah
> # 2203: wrong foo
> 
Yeah, I started doing it that way, but then I decided that it was making
the block rather long and that the extra benefit it would give is quite
small. But if people think it's worthwhile, I can rework to do so.

/Bruce

Patch
diff mbox series

diff --git a/config/meson.build b/config/meson.build
index 28a57f56f..6c46767e3 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -197,6 +197,12 @@  if not dpdk_conf.get('RTE_ARCH_64')
 # for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!!
 	warning_flags += '-Wno-pointer-to-int-cast'
 endif
+if cc.get_id() == 'intel'
+	warning_ids = [188, 2203, 2279, 2557, 3179, 3656]
+	foreach i:warning_ids
+		warning_flags += '-diag-disable=@0@'.format(i)
+	endforeach
+endif
 foreach arg: warning_flags
 	if cc.has_argument(arg)
 		add_project_arguments(arg, language: 'c')