[PATCH v2] examples: compilation fix for GCC-12
Thomas Monjalon
thomas at monjalon.net
Thu Oct 6 11:27:39 CEST 2022
02/09/2022 09:43, Amit Prakash Shukla:
> GCC-12 warns when a pointer of type union points to an array of same
> defined size, as union internally gets paded with pad bytes.
>
> ../examples/common/neon/port_group.h:42:21: error: array subscript
> 'union <anonymous>[0]' is partly outside array bounds of
> 'uint16_t[5]' {aka 'short unsigned int[5]'}
> [-Werror=array-bounds]
> 42 | pnum->u64 = gptbl[v].pnum;
> | ^~
> ../examples/common/neon/port_group.h:21:23: note: object 'pn' of
> size [0, 10]
> 21 | port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1
> | ~~~~~~~~~^~~~~~~~~~~~~~~
> ../examples/common/neon/port_group.h:43:21: error: array subscript
> 'union <anonymous>[0]' is partly outside array bounds of
> 'uint16_t[5]' {aka 'short unsigned int[5]'} [-Werror=array-bounds]
> 43 | pnum->u16[FWDSTEP] = 1;
> | ^~
>
> Fixes: bdfc3816fbfc ("examples: common packet group functionality")
Should be:
Fixes: 732115ce38c6 ("examples/l3fwd: move packet group function in common")
> Cc: stable at dpdk.org
>
> Signed-off-by: Amit Prakash Shukla <amitprakashs at marvell.com>
Applied, thanks.
More information about the stable
mailing list