Skip to contentSkip to conversation

test/prefetch: fix build with GCC 11

PATCH Applied Kevin Traynor 4 participants 4 messages May 20, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test/prefetch: 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 af75078fece3 ("first public release")
---
 app/test/test_prefetch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test_prefetch.c +1 -1
index 5489885b51..7b4a8e4144 100644
@@ -21,5 +21,5 @@ static int
 test_prefetch(void)
 {
-	int a;
+	int a = 0;
 
 	rte_prefetch0(&a);
Signature · 1 line
2.31.1
Tested-by on v1 1/1
#1 lore raw
Quoted 40 lines

-----Original Message-----
From: Kevin Traynor <[email protected]>
Sent: Thursday, May 20, 2021 2:06 PM
To: [email protected]
Cc: [email protected]; Kevin Traynor <[email protected]>; [email protected]; Ali Alnubani <[email protected]>
Subject: [PATCH] test/prefetch: 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 af75078fece3 ("first public release")
---
 app/test/test_prefetch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test_prefetch.c index renamed from app/test/test_prefetch.c +0 -0

5489885b51..7b4a8e4144 100644

app/test/test_prefetch.c +1 -2
@@ -21,5 +21,5 @@ static int
 test_prefetch(void)
 {
-	int a;
+	int a = 0;
 
 	rte_prefetch0(&a);
--
Quoted 1 line

2.31.1

Was about to send a fix 😊.
Thank you Kevin.

Build is now passing.

- Ali

Reviewed-by on v1 1/1
#2 lore raw
In reply to Kevin Traynor
Quoted 9 lines · Kevin Traynor

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);
      |         ^~~~~~~~~~~~~~~~~
Quoted 8 lines

Fix by initializing 'a'.

Bugzilla ID: 714

Fixes af75078fece3 ("first public release")
Signature · 1 line
David Marchand
#3 lore raw

20/05/2021 16:31, David Marchand:

Quoted 12 lines · Kevin Traynor
Quoted 11 lines

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'.

Quoted 8 lines
Quoted 6 lines

Bugzilla ID: 714

Fixes af75078fece3 ("first public release")

Applied, thanks