[PATCH 08/12] net/qede/base: fix build with GCC 12

David Marchand david.marchand at redhat.com
Wed May 18 12:16:53 CEST 2022


GCC raises the following warning:

In function ‘_mm256_storeu_si256’,
    inlined from ‘rte_mov32’ at
        ../lib/eal/x86/include/rte_memcpy.h:320:2,
    inlined from ‘rte_mov128’ at
        ../lib/eal/x86/include/rte_memcpy.h:342:2,
    inlined from ‘rte_memcpy_generic’ at
        ../lib/eal/x86/include/rte_memcpy.h:438:4,
    inlined from ‘rte_memcpy’ at
        ../lib/eal/x86/include/rte_memcpy.h:882:10,
    inlined from ‘__ecore_mcp_cmd_and_union’ at
        ../drivers/net/qede/base/ecore_mcp.c:541:3,
    inlined from ‘_ecore_mcp_cmd_and_union’ at
        ../drivers/net/qede/base/ecore_mcp.c:638:2,
    inlined from ‘ecore_mcp_cmd_and_union’ at
        ../drivers/net/qede/base/ecore_mcp.c:742:9:
/usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error:
        array subscript 1 is outside array bounds of
        ‘union drv_union_data[1]’ [-Werror=array-bounds]
  935 |   *__P = __A;
      |   ~~~~~^~~~~
../drivers/net/qede/base/ecore_mcp.c: In function
        ‘ecore_mcp_cmd_and_union’:
../drivers/net/qede/base/ecore_mcp.c:533:30: note: at offset 32 into
        object ‘union_data’ of size 32
  533 |         union drv_union_data union_data;
      |                              ^~~~~~~~~~

Since this code is in the base driver, waive the check until the base
driver is fixed by the relevant people.

Cc: stable at dpdk.org

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
 drivers/net/qede/base/meson.build | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/qede/base/meson.build b/drivers/net/qede/base/meson.build
index 4ad177b478..c7b19be20a 100644
--- a/drivers/net/qede/base/meson.build
+++ b/drivers/net/qede/base/meson.build
@@ -44,6 +44,11 @@ error_cflags = [
         '-Wno-sometimes-uninitialized',
         '-Wno-pointer-bool-conversion',
 ]
+# FIXME
+if (toolchain == 'gcc' and cc.version().version_compare('>=12.0.0'))
+    error_cflags += ['-Wno-array-bounds']
+endif
+
 c_args = cflags
 foreach flag: error_cflags
         if cc.has_argument(flag)
-- 
2.36.1



More information about the stable mailing list