[PATCH v2] net/ice/base: fix gcc 12 warning stringop-overflow
Zhang, Qi Z
qi.z.zhang at intel.com
Thu Jun 23 11:21:06 CEST 2022
> -----Original Message-----
> From: Wu, WenxuanX <wenxuanx.wu at intel.com>
> Sent: Thursday, June 23, 2022 5:01 PM
> To: dev at dpdk.org; thomas at monjalon.net; Yang, Qiming
> <qiming.yang at intel.com>; Zhang, Qi Z <qi.z.zhang at intel.com>
> Cc: stephen at networkplumber.org; Wu, WenxuanX
> <wenxuanx.wu at intel.com>; Zhou, YidingX <yidingx.zhou at intel.com>;
> stable at dpdk.org
> Subject: [PATCH v2] net/ice/base: fix gcc 12 warning stringop-overflow
>
> From: Wenxuan Wu <wenxuanx.wu at intel.com>
>
> gcc 12 with -O2 flag would raise the following warning:
> ../drivers/net/ice/base/ice_switch.c:7220:61: error: writing 1 byte into a region
> of size 0 [-Werror=stringop-overflow=]
> 7220 | buf[recps].content.lkup_indx[i + 1] = entry->fv_idx[i];
> |
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
>
> This patch changed the type of fv_idx in struct ice_recp_grp_entry to align with
> its callers which are also u8 type.
>
> Fixes: 04b8ec1ea807 ("net/ice/base: add protocol structures and defines")
> Cc: stable at dpdk.org
>
> Signed-off-by: Wenxuan Wu <wenxuanx.wu at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
More information about the stable
mailing list