[PATCH] ring: compilation fix with GCC-12
Stephen Hemminger
stephen at networkplumber.org
Fri Aug 5 17:37:23 CEST 2022
On Fri, 5 Aug 2022 14:33:48 +0530
Amit Prakash Shukla <amitprakashs at marvell.com> wrote:
> GCC 12 raises the following warning:
>
> In function '__rte_ring_dequeue_elems_128',
> inlined from '__rte_ring_dequeue_elems' at
> ../lib/ring/rte_ring_elem_pvt.h:262:3,
> inlined from '__rte_ring_do_hts_dequeue_elem' at
> ../lib/ring/rte_ring_hts_elem_pvt.h:237:3,
> inlined from 'rte_ring_mc_hts_dequeue_bulk_elem' at
> ../lib/ring/rte_ring_hts.h:83:9,
> inlined from 'rte_ring_dequeue_bulk_elem' at
> ../lib/ring/rte_ring_elem.h:391:10,
> inlined from 'rte_ring_dequeue_elem' at
> ../lib/ring/rte_ring_elem.h:476:9,
> inlined from 'rte_ring_dequeue' at
> ../lib/ring/rte_ring.h:463:9,
> inlined from 'rxa_intr_ring_dequeue' at
> ../lib/eventdev/rte_event_eth_rx_adapter.c:1196:10:
> ../lib/ring/rte_ring_elem_pvt.h:234:25: error: 'memcpy' writing
> 32 bytes into a region of size 8 overflows the destination
> [-Werror=stringop-overflow=]
> 234 | memcpy((void *)(obj + i), (void *)(ring + idx), 32);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Replacing memcpy with rte_memcpy fixes the GCC-12 compilation issue.
> Also it would be better to change to rte_memcpy as the function is
> called in fastpath.
>
> Bugzilla ID: 1062
> Fixes: 1fc73390bcf5 ("ring: refactor exported headers")
> Cc: stable at dpdk.org
>
> Signed-off-by: Amit Prakash Shukla <amitprakashs at marvell.com>
This seems to be just using a different routine and in effect
wallpapering over a possibly valid warning.
More information about the dev
mailing list