* [PATCH 19.11] net/ice: fix meson build error with gcc11.2
@ 2022-08-03 6:12 Steve Yang
2022-08-03 10:13 ` Christian Ehrhardt
0 siblings, 1 reply; 2+ messages in thread
From: Steve Yang @ 2022-08-03 6:12 UTC (permalink / raw)
To: stable; +Cc: qiming.yang, qi.z.zhang, Steve Yang
When user built latest DPDK 19.11 with gcc11.2, got error message as below:
../drivers/net/ice/ice_rxtx.c:1365:18: error: array subscript
‘volatile struct ice_32b_rx_flex_desc_comms[0]’ is partly outside array
bounds of ‘union ice_16b_rx_flex_desc[1]’ [-Werror=array-bounds]
1365 | stat_err = rte_le_to_cpu_16(desc->status_error0);
../drivers/net/ice/ice_rxtx.c:2090:32: note: while referencing ‘rxd’
2090 | union ice_rx_flex_desc rxd;
| ^~~
In file included from ../lib/librte_mbuf/rte_mbuf.h:43,
from ../lib/librte_net/rte_ether.h:23,
from ../lib/librte_ethdev/rte_ethdev.h:159,
from ../lib/librte_ethdev/rte_ethdev_driver.h:18,
from ../drivers/net/ice/ice_rxtx.c:5:
cc1: all warnings being treated as errors
Because the 'desc->status_error0' belongs to 'ice_16b_rx_flex_desc[0]',
it cannot be outside array bounds, so, this warning should be skipped
with gcc option '-Wno-array-bounds' for gcc11.2.
Bugzilla ID: 1055
Fixes: dbf3c0e77a22 ("net/ice: handle Rx flex descriptor")
Signed-off-by: Steve Yang <stevex.yang@intel.com>
---
drivers/net/ice/meson.build | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ice/meson.build b/drivers/net/ice/meson.build
index f9e897bbc2..3c62ed7306 100644
--- a/drivers/net/ice/meson.build
+++ b/drivers/net/ice/meson.build
@@ -18,6 +18,10 @@ sources = files(
deps += ['hash']
includes += include_directories('base')
+if (toolchain == 'gcc' and cc.version().version_compare('>=11.0.0'))
+ cflags += '-Wno-array-bounds'
+endif
+
if arch_subdir == 'x86'
sources += files('ice_rxtx_vec_sse.c')
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 19.11] net/ice: fix meson build error with gcc11.2
2022-08-03 6:12 [PATCH 19.11] net/ice: fix meson build error with gcc11.2 Steve Yang
@ 2022-08-03 10:13 ` Christian Ehrhardt
0 siblings, 0 replies; 2+ messages in thread
From: Christian Ehrhardt @ 2022-08-03 10:13 UTC (permalink / raw)
To: Steve Yang; +Cc: stable, qiming.yang, qi.z.zhang
On Wed, Aug 3, 2022 at 8:23 AM Steve Yang <stevex.yang@intel.com> wrote:
>
> When user built latest DPDK 19.11 with gcc11.2, got error message as below:
Thank you for the help keeping the old releases buildable.
This is queued now, it depends if we will have a -rc2 if it will be in
19.11.13 or 19.11.14.
> ../drivers/net/ice/ice_rxtx.c:1365:18: error: array subscript
> ‘volatile struct ice_32b_rx_flex_desc_comms[0]’ is partly outside array
> bounds of ‘union ice_16b_rx_flex_desc[1]’ [-Werror=array-bounds]
> 1365 | stat_err = rte_le_to_cpu_16(desc->status_error0);
> ../drivers/net/ice/ice_rxtx.c:2090:32: note: while referencing ‘rxd’
> 2090 | union ice_rx_flex_desc rxd;
> | ^~~
> In file included from ../lib/librte_mbuf/rte_mbuf.h:43,
> from ../lib/librte_net/rte_ether.h:23,
> from ../lib/librte_ethdev/rte_ethdev.h:159,
> from ../lib/librte_ethdev/rte_ethdev_driver.h:18,
> from ../drivers/net/ice/ice_rxtx.c:5:
> cc1: all warnings being treated as errors
>
> Because the 'desc->status_error0' belongs to 'ice_16b_rx_flex_desc[0]',
> it cannot be outside array bounds, so, this warning should be skipped
> with gcc option '-Wno-array-bounds' for gcc11.2.
>
> Bugzilla ID: 1055
> Fixes: dbf3c0e77a22 ("net/ice: handle Rx flex descriptor")
>
> Signed-off-by: Steve Yang <stevex.yang@intel.com>
> ---
> drivers/net/ice/meson.build | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ice/meson.build b/drivers/net/ice/meson.build
> index f9e897bbc2..3c62ed7306 100644
> --- a/drivers/net/ice/meson.build
> +++ b/drivers/net/ice/meson.build
> @@ -18,6 +18,10 @@ sources = files(
> deps += ['hash']
> includes += include_directories('base')
>
> +if (toolchain == 'gcc' and cc.version().version_compare('>=11.0.0'))
> + cflags += '-Wno-array-bounds'
> +endif
> +
> if arch_subdir == 'x86'
> sources += files('ice_rxtx_vec_sse.c')
>
> --
> 2.25.1
>
--
Christian Ehrhardt
Senior Staff Engineer, Ubuntu Server
Canonical Ltd
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-03 10:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03 6:12 [PATCH 19.11] net/ice: fix meson build error with gcc11.2 Steve Yang
2022-08-03 10:13 ` Christian Ehrhardt
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).