[PATCH 21.11] ring: squash gcc 12.2.1 warnings

Kevin Traynor ktraynor at redhat.com
Tue Dec 20 18:18:49 CET 2022


On 20/12/2022 12:37, Kevin Traynor wrote:
> gcc 12.2.1 on Fedora 37 is giving stringop-overread and
> stringop-overflow warnings when compiled with --buildtype=debug
> e.g. [1].
> 
> These are not yet fixed on main branch. They look similar
> to the overflow issues previously squashed in rte_memcpy with
> commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")
> 
> In order to ensure DPDK 21.11.3 compiles on Fedora 37, squash these
> warnings. If a subsequent cleaner fix becomes available on from main
> branch it can be backported to later DPDK 21.11 LTS release.
> 
> [1]
> lib/ring/rte_ring_elem_pvt.h:100:25: error:
> ‘memcpy’ reading 32 bytes from a region of size 4
> [-Werror=stringop-overread]
> 100 |               memcpy((void *)(ring + idx),
>      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 101 |                       (const void *)(obj + i), 32);
>      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> lib/ring/rte_ring_elem_pvt.h:234:25: error:
> ‘memcpy’ writing 32 bytes into a region of size 4 overflows the destination
> [-Werror=stringop-overflow=]
> 234 |               memcpy((void *)(obj + i), (void *)(ring + idx), 32);
>      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Kevin Traynor<ktraynor at redhat.com>
> ---

Pushed to 21.11 branch for 21.11.3. Thanks.



More information about the stable mailing list