Skip to content

Commit

Permalink
test: fix build with GCC 11
Browse files Browse the repository at this point in the history
[ upstream commit 50eea2b ]

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: af75078 ("first public release")

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>
  • Loading branch information
kevintraynor authored and cpaelzer committed Jun 10, 2021
1 parent 27eb84d commit 640dec2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/test/test_prefetch.c
Expand Up @@ -20,7 +20,7 @@
static int
test_prefetch(void)
{
int a;
int a = 0;

rte_prefetch0(&a);
rte_prefetch1(&a);
Expand Down

0 comments on commit 640dec2

Please sign in to comment.