patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] build: disable gcc 10 zero-length-bounds warning
@ 2020-05-14 13:18 Kevin Traynor
  2020-05-15  8:28 ` David Marchand
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Traynor @ 2020-05-14 13:18 UTC (permalink / raw)
  To: dev, thomas, bruce.richardson
  Cc: ferruh.yigit, david.marchand, Gavin.Hu, Honnappa.Nagarahalli,
	olivier.matz, Kevin Traynor, stable

gcc 10 issues warnings about the use of rearm_data marker
from struct rte_mbuf.

e.g.
../drivers/net/enic/enic_rxtx_vec_avx2.c: In function ‘rx_one’:
../drivers/net/enic/enic_rxtx_vec_avx2.c:21:2:
warning:
array subscript 0 is outside the bounds of an interior zero-length array
‘RTE_MARKER64’ {aka ‘long unsigned int[0]’} [-Wzero-length-bounds]
   21 |  *(uint64_t *)&mb->rearm_data = enic->mbuf_initializer;
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../lib/librte_mbuf/rte_mbuf.h:45,
                 from ../drivers/net/enic/enic_rxtx_vec_avx2.c:6:
../lib/librte_mbuf/rte_mbuf_core.h:484:15:
note: while referencing ‘rearm_data’
  484 |  RTE_MARKER64 rearm_data;
      |

Disable this warning for gcc 10 in order to allow v20.05 to build
without changes to struct rte_mbuf.

Bugzilla ID: 396
Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>

---
Sending as per discussion at this mornings release meeting:
http://inbox.dpdk.org/dev/2980eb50-124c-9da8-9927-0678081b652b@intel.com/

Reference to Gavin's patch:
http://inbox.dpdk.org/dev/CAJFAV8yL2GvEJtTXOLk6o0eXHi4CpZmqCoRsfN2WcDe_ju1C8A@mail.gmail.com/#t
---
 config/meson.build           | 4 ++++
 mk/toolchain/gcc/rte.vars.mk | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/config/meson.build b/config/meson.build
index a1c38c053..43ab11310 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -209,4 +209,8 @@ warning_flags = [
 	'-Wno-missing-field-initializers'
 ]
+if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0')
+# FIXME: Bugzilla 396
+	warning_flags += '-Wno-zero-length-bounds'
+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!!
diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index f19305e49..928f0e083 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -82,4 +82,9 @@ WERROR_FLAGS += -Wno-uninitialized
 endif
 
+ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1)
+# FIXME: Bugzilla 396
+WERROR_FLAGS += -Wno-zero-length-bounds
+endif
+
 HOST_WERROR_FLAGS := $(WERROR_FLAGS)
 
-- 
2.21.3


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

* Re: [dpdk-stable] [PATCH] build: disable gcc 10 zero-length-bounds warning
  2020-05-14 13:18 [dpdk-stable] [PATCH] build: disable gcc 10 zero-length-bounds warning Kevin Traynor
@ 2020-05-15  8:28 ` David Marchand
  2020-05-18  9:52   ` David Marchand
  2020-05-18 11:50   ` David Marchand
  0 siblings, 2 replies; 4+ messages in thread
From: David Marchand @ 2020-05-15  8:28 UTC (permalink / raw)
  To: Kevin Traynor
  Cc: dev, Thomas Monjalon, Bruce Richardson, Yigit, Ferruh, Gavin Hu,
	Honnappa Nagarahalli, Olivier Matz, dpdk stable

On Thu, May 14, 2020 at 3:19 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> gcc 10 issues warnings about the use of rearm_data marker
> from struct rte_mbuf.
>
> e.g.
> ../drivers/net/enic/enic_rxtx_vec_avx2.c: In function ‘rx_one’:
> ../drivers/net/enic/enic_rxtx_vec_avx2.c:21:2:
> warning:
> array subscript 0 is outside the bounds of an interior zero-length array
> ‘RTE_MARKER64’ {aka ‘long unsigned int[0]’} [-Wzero-length-bounds]
>    21 |  *(uint64_t *)&mb->rearm_data = enic->mbuf_initializer;
>       |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from ../lib/librte_mbuf/rte_mbuf.h:45,
>                  from ../drivers/net/enic/enic_rxtx_vec_avx2.c:6:
> ../lib/librte_mbuf/rte_mbuf_core.h:484:15:
> note: while referencing ‘rearm_data’
>   484 |  RTE_MARKER64 rearm_data;
>       |
>
> Disable this warning for gcc 10 in order to allow v20.05 to build
> without changes to struct rte_mbuf.
>
> Bugzilla ID: 396
> Cc: stable@dpdk.org
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
>
> ---
> Sending as per discussion at this mornings release meeting:
> http://inbox.dpdk.org/dev/2980eb50-124c-9da8-9927-0678081b652b@intel.com/
>
> Reference to Gavin's patch:
> http://inbox.dpdk.org/dev/CAJFAV8yL2GvEJtTXOLk6o0eXHi4CpZmqCoRsfN2WcDe_ju1C8A@mail.gmail.com/#t
> ---
>  config/meson.build           | 4 ++++
>  mk/toolchain/gcc/rte.vars.mk | 5 +++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/config/meson.build b/config/meson.build
> index a1c38c053..43ab11310 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -209,4 +209,8 @@ warning_flags = [
>         '-Wno-missing-field-initializers'
>  ]
> +if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0')
> +# FIXME: Bugzilla 396
> +       warning_flags += '-Wno-zero-length-bounds'
> +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!!
> diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
> index f19305e49..928f0e083 100644
> --- a/mk/toolchain/gcc/rte.vars.mk
> +++ b/mk/toolchain/gcc/rte.vars.mk
> @@ -82,4 +82,9 @@ WERROR_FLAGS += -Wno-uninitialized
>  endif
>
> +ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1)
> +# FIXME: Bugzilla 396
> +WERROR_FLAGS += -Wno-zero-length-bounds
> +endif
> +
>  HOST_WERROR_FLAGS := $(WERROR_FLAGS)
>
> --
> 2.21.3
>

Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


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

* Re: [dpdk-stable] [PATCH] build: disable gcc 10 zero-length-bounds warning
  2020-05-15  8:28 ` David Marchand
@ 2020-05-18  9:52   ` David Marchand
  2020-05-18 11:50   ` David Marchand
  1 sibling, 0 replies; 4+ messages in thread
From: David Marchand @ 2020-05-18  9:52 UTC (permalink / raw)
  To: Olivier Matz, Bruce Richardson, Thomas Monjalon
  Cc: dev, Yigit, Ferruh, Gavin Hu, Honnappa Nagarahalli,
	Kevin Traynor, dpdk stable

On Fri, May 15, 2020 at 10:28 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Thu, May 14, 2020 at 3:19 PM Kevin Traynor <ktraynor@redhat.com> wrote:
> >
> > gcc 10 issues warnings about the use of rearm_data marker
> > from struct rte_mbuf.
> >
> > e.g.
> > ../drivers/net/enic/enic_rxtx_vec_avx2.c: In function ‘rx_one’:
> > ../drivers/net/enic/enic_rxtx_vec_avx2.c:21:2:
> > warning:
> > array subscript 0 is outside the bounds of an interior zero-length array
> > ‘RTE_MARKER64’ {aka ‘long unsigned int[0]’} [-Wzero-length-bounds]
> >    21 |  *(uint64_t *)&mb->rearm_data = enic->mbuf_initializer;
> >       |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > In file included from ../lib/librte_mbuf/rte_mbuf.h:45,
> >                  from ../drivers/net/enic/enic_rxtx_vec_avx2.c:6:
> > ../lib/librte_mbuf/rte_mbuf_core.h:484:15:
> > note: while referencing ‘rearm_data’
> >   484 |  RTE_MARKER64 rearm_data;
> >       |
> >
> > Disable this warning for gcc 10 in order to allow v20.05 to build
> > without changes to struct rte_mbuf.
> >
> > Bugzilla ID: 396
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> >
> > ---
> > Sending as per discussion at this mornings release meeting:
> > http://inbox.dpdk.org/dev/2980eb50-124c-9da8-9927-0678081b652b@intel.com/
> >
> > Reference to Gavin's patch:
> > http://inbox.dpdk.org/dev/CAJFAV8yL2GvEJtTXOLk6o0eXHi4CpZmqCoRsfN2WcDe_ju1C8A@mail.gmail.com/#t
> > ---
> >  config/meson.build           | 4 ++++
> >  mk/toolchain/gcc/rte.vars.mk | 5 +++++
> >  2 files changed, 9 insertions(+)
> >
> > diff --git a/config/meson.build b/config/meson.build
> > index a1c38c053..43ab11310 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -209,4 +209,8 @@ warning_flags = [
> >         '-Wno-missing-field-initializers'
> >  ]
> > +if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0')
> > +# FIXME: Bugzilla 396
> > +       warning_flags += '-Wno-zero-length-bounds'
> > +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!!
> > diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
> > index f19305e49..928f0e083 100644
> > --- a/mk/toolchain/gcc/rte.vars.mk
> > +++ b/mk/toolchain/gcc/rte.vars.mk
> > @@ -82,4 +82,9 @@ WERROR_FLAGS += -Wno-uninitialized
> >  endif
> >
> > +ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1)
> > +# FIXME: Bugzilla 396
> > +WERROR_FLAGS += -Wno-zero-length-bounds
> > +endif
> > +
> >  HOST_WERROR_FLAGS := $(WERROR_FLAGS)
> >
> > --
> > 2.21.3
> >
>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

No objection on this patch, so I'll proceed and merge it for rc3.


-- 
David Marchand


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

* Re: [dpdk-stable] [PATCH] build: disable gcc 10 zero-length-bounds warning
  2020-05-15  8:28 ` David Marchand
  2020-05-18  9:52   ` David Marchand
@ 2020-05-18 11:50   ` David Marchand
  1 sibling, 0 replies; 4+ messages in thread
From: David Marchand @ 2020-05-18 11:50 UTC (permalink / raw)
  To: Kevin Traynor
  Cc: dev, Thomas Monjalon, Bruce Richardson, Yigit, Ferruh, Gavin Hu,
	Honnappa Nagarahalli, Olivier Matz, dpdk stable

On Fri, May 15, 2020 at 10:28 AM David Marchand
<david.marchand@redhat.com> wrote:
> On Thu, May 14, 2020 at 3:19 PM Kevin Traynor <ktraynor@redhat.com> wrote:
> >
> > gcc 10 issues warnings about the use of rearm_data marker
> > from struct rte_mbuf.
> >
> > e.g.
> > ../drivers/net/enic/enic_rxtx_vec_avx2.c: In function ‘rx_one’:
> > ../drivers/net/enic/enic_rxtx_vec_avx2.c:21:2:
> > warning:
> > array subscript 0 is outside the bounds of an interior zero-length array
> > ‘RTE_MARKER64’ {aka ‘long unsigned int[0]’} [-Wzero-length-bounds]
> >    21 |  *(uint64_t *)&mb->rearm_data = enic->mbuf_initializer;
> >       |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > In file included from ../lib/librte_mbuf/rte_mbuf.h:45,
> >                  from ../drivers/net/enic/enic_rxtx_vec_avx2.c:6:
> > ../lib/librte_mbuf/rte_mbuf_core.h:484:15:
> > note: while referencing ‘rearm_data’
> >   484 |  RTE_MARKER64 rearm_data;
> >       |
> >
> > Disable this warning for gcc 10 in order to allow v20.05 to build
> > without changes to struct rte_mbuf.
> >
> > Bugzilla ID: 396
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.


-- 
David Marchand


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

end of thread, other threads:[~2020-05-18 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-14 13:18 [dpdk-stable] [PATCH] build: disable gcc 10 zero-length-bounds warning Kevin Traynor
2020-05-15  8:28 ` David Marchand
2020-05-18  9:52   ` David Marchand
2020-05-18 11:50   ` David Marchand

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).