[PATCH] build: fix meson build when gcc >= 10.0

Stephen Hemminger stephen at networkplumber.org
Tue Jun 7 17:25:26 CEST 2022


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

> On Tue, Jun 7, 2022 at 5:10 PM Stephen Hemminger
> <stephen at networkplumber.org> wrote:
> > On Tue, 07 Jun 2022 12:52:32 +0200
> > Thomas Monjalon <thomas at monjalon.net> wrote:  
> > > 07/06/2022 04:56, wenxuanx.wu at intel.com:  
> > > > From: Wenxuan Wu <wenxuanx.wu at 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.


More information about the stable mailing list