test: fix build with GCC 11

GCC 11 complains that 'a' is uninitialized.

../dpdk/app/test/test_prefetch.c: In function 'test_prefetch':
../dpdk/app/test/test_prefetch.c:25:9:
error: 'a' may be used uninitialized [-Werror=maybe-uninitialized]
   25 |         rte_prefetch0(&a);
      |         ^~~~~~~~~~~~~~~~~

Fix by initializing 'a'.

Bugzilla ID: 714
Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Reported-by: Ali Alnubani <alialnu@nvidia.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
This commit is contained in:
Kevin Traynor 2021-05-20 12:06:12 +01:00 committed by Thomas Monjalon
parent e32b525aae
commit 50eea2bfa7

View File

@ -20,7 +20,7 @@
static int
test_prefetch(void)
{
int a;
int a = 0;
rte_prefetch0(&a);
rte_prefetch1(&a);