代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dpdk 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 2889419e10a68fad89df35350a1ea5e41e4cbf35 Mon Sep 17 00:00:00 2001
From: j00660176 <jiangheng14@huawei.com>
Date: Wed, 12 Jul 2023 16:39:56 +0800
Subject: [PATCH] example/l3fwd: masking wrong warning array subscript [0] is
partly outside array bounds
GCC 12 raises the following warning:
In file included from ../examples/l3fwd/l3fwd_lpm_neon.h:11,
from ../examples/l3fwd/l3fwd_lpm.c:135:
../examples/l3fwd/l3fwd_neon.h: In function 'port_groupx4':
../examples/l3fwd/l3fwd_neon.h:95:21: error: array subscript 'union <anonymous>[0]' is partly outside array bounds of 'uint16_t[5]' {aka 'short unsigned int[5]'} [-Werror=array-bounds]
95 | pnum->u64 = gptbl[v].pnum;
| ^~
../examples/l3fwd/l3fwd_neon.h:74:23: note: object 'pn' of size [0, 10]
74 | port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1,
| ~~~~~~~~~^~~~~~~~~~~~~~~
../examples/l3fwd/l3fwd_neon.h:96:21: error: array subscript 'union <anonymous>[0]' is partly outside array bounds of 'uint16_t[5]' {aka 'short unsigned int[5]'} [-Werror=array-bounds]
96 | pnum->u16[FWDSTEP] = 1;
| ^~
../examples/l3fwd/l3fwd_neon.h:74:23: note: object 'pn' of size [0, 10]
74 | port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1,
| ~~~~~~~~~^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
according to the code review, this is a wrong warning:
pnum's size is uint16_t * 5 = 10, FWDSTEP is 4, line 96 access pnum->[4]; lin95 access accesses a 64-bit value, taking up the first four elements of a number.
due to patch 0002-dpdk-add-secure-compile-option-and-fPIC-option.patch, it treats warnings as errors. so the l3fwd compilation fails.
---
examples/l3fwd/meson.build | 2 ++
1 file changed, 2 insertions(+)
diff --git a/examples/l3fwd/meson.build b/examples/l3fwd/meson.build
index 0830b3e..827206e 100644
--- a/examples/l3fwd/meson.build
+++ b/examples/l3fwd/meson.build
@@ -7,6 +7,8 @@
# DPDK instance, use 'make'
allow_experimental_apis = true
+cflags += ['-Wno-array-bounds']
+
deps += ['hash', 'lpm', 'fib', 'eventdev']
sources = files(
'l3fwd_em.c',
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。