DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] build: fix meson build when gcc >= 10.0
@ 2022-06-07  2:56 wenxuanx.wu
  2022-06-07 10:52 ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: wenxuanx.wu @ 2022-06-07  2:56 UTC (permalink / raw)
  To: bruce.richardson, dev; +Cc: Wenxuan Wu, stable

From: Wenxuan Wu <wenxuanx.wu@intel.com>

GCC version greater than 10.0, with compile option -O2, several warnings info would appear,
this fix omitted these warnings.

Fixes: cfacbcb5a23b ("build: disable gcc 10 zero-length-bounds warning")
Cc: stable@dpdk.org

Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>
---
 config/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/config/meson.build b/config/meson.build
index 7134e80e8d..97f0ea6cca 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -273,7 +273,12 @@ warning_flags = [
 ]
 if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0')
 # FIXME: Bugzilla 396
-    warning_flags += '-Wno-zero-length-bounds'
+    warning_flags += [
+      '-Wno-zero-length-bounds',
+      '-Wno-stringop-overflow',
+      '-Wno-array-bounds',
+      '-Wno-format-overflow',
+      ]
 endif
 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!!
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] build: fix meson build when gcc >= 10.0
  2022-06-07  2:56 [PATCH] build: fix meson build when gcc >= 10.0 wenxuanx.wu
@ 2022-06-07 10:52 ` Thomas Monjalon
  2022-06-07 15:09   ` Stephen Hemminger
  2022-06-08  3:27   ` Wu, WenxuanX
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Monjalon @ 2022-06-07 10:52 UTC (permalink / raw)
  To: Wenxuan Wu; +Cc: bruce.richardson, dev, stable, david.marchand

07/06/2022 04:56, wenxuanx.wu@intel.com:
> From: Wenxuan Wu <wenxuanx.wu@intel.com>
> 
> GCC version greater than 10.0, with compile option -O2, several warnings info would appear,
> this fix omitted these warnings.
[...]
>  # FIXME: Bugzilla 396
> -    warning_flags += '-Wno-zero-length-bounds'
> +    warning_flags += [
> +      '-Wno-zero-length-bounds',
> +      '-Wno-stringop-overflow',
> +      '-Wno-array-bounds',
> +      '-Wno-format-overflow',

The compilers are reported warnings to help us having a better code.
We should try to resolve the warnings, not hiding them.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] build: fix meson build when gcc >= 10.0
  2022-06-07 10:52 ` Thomas Monjalon
@ 2022-06-07 15:09   ` Stephen Hemminger
  2022-06-07 15:13     ` David Marchand
  2022-06-08  3:27   ` Wu, WenxuanX
  1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2022-06-07 15:09 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Wenxuan Wu, bruce.richardson, dev, stable, david.marchand

On Tue, 07 Jun 2022 12:52:32 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:

> 07/06/2022 04:56, wenxuanx.wu@intel.com:
> > From: Wenxuan Wu <wenxuanx.wu@intel.com>
> > 
> > GCC version greater than 10.0, with compile option -O2, several warnings info would appear,
> > this fix omitted these warnings.  
> [...]
> >  # FIXME: Bugzilla 396
> > -    warning_flags += '-Wno-zero-length-bounds'
> > +    warning_flags += [
> > +      '-Wno-zero-length-bounds',
> > +      '-Wno-stringop-overflow',
> > +      '-Wno-array-bounds',
> > +      '-Wno-format-overflow',  
> 
> The compilers are reported warnings to help us having a better code.
> We should try to resolve the warnings, not hiding them.
> 
> 

Agree with Thomas. This not how to address this.
There are fixes already for the zero-length-bounds that are being merged.
Patches accepted to fix the rest.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] build: fix meson build when gcc >= 10.0
  2022-06-07 15:09   ` Stephen Hemminger
@ 2022-06-07 15:13     ` David Marchand
  2022-06-07 15:25       ` Stephen Hemminger
  0 siblings, 1 reply; 6+ messages in thread
From: David Marchand @ 2022-06-07 15:13 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Thomas Monjalon, Wenxuan Wu, Bruce Richardson, dev, dpdk stable

On Tue, Jun 7, 2022 at 5:10 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
> On Tue, 07 Jun 2022 12:52:32 +0200
> Thomas Monjalon <thomas@monjalon.net> wrote:
> > 07/06/2022 04:56, wenxuanx.wu@intel.com:
> > > From: Wenxuan Wu <wenxuanx.wu@intel.com>
> > >
> > > GCC version greater than 10.0, with compile option -O2, several warnings info would appear,
> > > this fix omitted these warnings.
> > [...]
> > >  # FIXME: Bugzilla 396
> > > -    warning_flags += '-Wno-zero-length-bounds'
> > > +    warning_flags += [
> > > +      '-Wno-zero-length-bounds',
> > > +      '-Wno-stringop-overflow',
> > > +      '-Wno-array-bounds',
> > > +      '-Wno-format-overflow',
> >
> > The compilers are reported warnings to help us having a better code.
> > We should try to resolve the warnings, not hiding them.
> >
> >
>
> Agree with Thomas. This not how to address this.
> There are fixes already for the zero-length-bounds that are being merged.

I just merged them, though, afaics, they fix none of the compilation
issues reported with gcc 12.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] build: fix meson build when gcc >= 10.0
  2022-06-07 15:13     ` David Marchand
@ 2022-06-07 15:25       ` Stephen Hemminger
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2022-06-07 15:25 UTC (permalink / raw)
  To: David Marchand
  Cc: Thomas Monjalon, Wenxuan Wu, Bruce Richardson, dev, dpdk stable

On Tue, 7 Jun 2022 17:13:07 +0200
David Marchand <david.marchand@redhat.com> wrote:

> On Tue, Jun 7, 2022 at 5:10 PM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> > On Tue, 07 Jun 2022 12:52:32 +0200
> > Thomas Monjalon <thomas@monjalon.net> wrote:  
> > > 07/06/2022 04:56, wenxuanx.wu@intel.com:  
> > > > From: Wenxuan Wu <wenxuanx.wu@intel.com>
> > > >
> > > > GCC version greater than 10.0, with compile option -O2, several warnings info would appear,
> > > > this fix omitted these warnings.  
> > > [...]  
> > > >  # FIXME: Bugzilla 396
> > > > -    warning_flags += '-Wno-zero-length-bounds'
> > > > +    warning_flags += [
> > > > +      '-Wno-zero-length-bounds',
> > > > +      '-Wno-stringop-overflow',
> > > > +      '-Wno-array-bounds',
> > > > +      '-Wno-format-overflow',  
> > >
> > > The compilers are reported warnings to help us having a better code.
> > > We should try to resolve the warnings, not hiding them.
> > >
> > >  
> >
> > Agree with Thomas. This not how to address this.
> > There are fixes already for the zero-length-bounds that are being merged.  
> 
> I just merged them, though, afaics, they fix none of the compilation
> issues reported with gcc 12.
> 
> 

I noticed that several of the gcc 12 issues are because rte_memcpy can access
past the end of the input array in some cases.

Since most of these are small arrays like RSS keys. The simplest fix would
be skip using rte_memcpy (and just use memcpy) for all these trivial places
which are not performance sensitive.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] build: fix meson build when gcc >= 10.0
  2022-06-07 10:52 ` Thomas Monjalon
  2022-06-07 15:09   ` Stephen Hemminger
@ 2022-06-08  3:27   ` Wu, WenxuanX
  1 sibling, 0 replies; 6+ messages in thread
From: Wu, WenxuanX @ 2022-06-08  3:27 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Richardson, Bruce, dev, stable, david.marchand

Hi Thomas,

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: 2022年6月7日 18:53
> To: Wu, WenxuanX <wenxuanx.wu@intel.com>
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; dev@dpdk.org;
> stable@dpdk.org; david.marchand@redhat.com
> Subject: Re: [PATCH] build: fix meson build when gcc >= 10.0
> 
> 07/06/2022 04:56, wenxuanx.wu@intel.com:
> > From: Wenxuan Wu <wenxuanx.wu@intel.com>
> >
> > GCC version greater than 10.0, with compile option -O2, several
> > warnings info would appear, this fix omitted these warnings.
> [...]
> >  # FIXME: Bugzilla 396
> > -    warning_flags += '-Wno-zero-length-bounds'
> > +    warning_flags += [
> > +      '-Wno-zero-length-bounds',
> > +      '-Wno-stringop-overflow',
> > +      '-Wno-array-bounds',
> > +      '-Wno-format-overflow',
> 
> The compilers are reported warnings to help us having a better code.
> We should try to resolve the warnings, not hiding them.
> 
Yeah,  I can not agree more.  Need to draw more attention to handle these warnings. 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-08  3:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-07  2:56 [PATCH] build: fix meson build when gcc >= 10.0 wenxuanx.wu
2022-06-07 10:52 ` Thomas Monjalon
2022-06-07 15:09   ` Stephen Hemminger
2022-06-07 15:13     ` David Marchand
2022-06-07 15:25       ` Stephen Hemminger
2022-06-08  3:27   ` Wu, WenxuanX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).