[PATCH 04/12] net/ena: fix build with GCC 12
Stephen Hemminger
stephen at networkplumber.org
Sat Jun 11 17:34:43 CEST 2022
On Wed, 18 May 2022 12:16:49 +0200
David Marchand <david.marchand at redhat.com> wrote:
> GCC 12 raises the following warning:
>
> In file included from ../lib/mempool/rte_mempool.h:46,
> from ../lib/mbuf/rte_mbuf.h:38,
> from ../lib/net/rte_ether.h:22,
> from ../drivers/net/ena/ena_ethdev.h:10,
> from ../drivers/net/ena/ena_rss.c:6:
> ../drivers/net/ena/ena_rss.c: In function ‘ena_rss_key_fill’:
> ../lib/eal/x86/include/rte_memcpy.h:370:9: warning: array subscript 64 is
> outside array bounds of ‘uint8_t[40]’ {aka ‘unsigned char[40]’}
> [-Warray-bounds]
> 370 | rte_mov32((uint8_t *)dst + 2 * 32, (const uint8_t *)src + 2 * 32);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/net/ena/ena_rss.c:51:24: note: while referencing ‘default_key’
> 51 | static uint8_t default_key[ENA_HASH_KEY_SIZE];
> | ^~~~~~~~~~~
>
> This is a false positive because the copied size is checked against
> ENA_HASH_KEY_SIZE in a (build) assert.
> Silence this warning by calling memcpy with the minimal size.
>
> Cc: stable at dpdk.org
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
More information about the dev
mailing list