Skip to contentSkip to conversation

linux-test.c: Remove unused but set variable

PATCH In review Taylor Simpson 3 participants 4 messages Jan 5, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-test.c: Remove unused but set variable

Some versions of clang will warn on this with -Wall Then, it will be an error with -Werror

---
 tests/tcg/multiarch/linux/linux-test.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
tests/tcg/multiarch/linux/linux-test.c +1 -3
index 5a2a4f2258..10943d5310 100644
@@ -332,12 +332,11 @@ static void test_pipe(void)
     fd_set rfds, wfds;
     int fds[2], fd_max, ret;
     uint8_t ch;
-    int wcount, rcount;
+    int rcount;
 
     chk_error(pipe(fds));
     chk_error(fcntl(fds[0], F_SETFL, O_NONBLOCK));
     chk_error(fcntl(fds[1], F_SETFL, O_NONBLOCK));
-    wcount = 0;
     rcount = 0;
     for(;;) {
         FD_ZERO(&rfds);
@@ -360,7 +359,6 @@ static void test_pipe(void)
             if (FD_ISSET(fds[1], &wfds)) {
                 ch = 'a';
                 chk_error(write(fds[1], &ch, 1));
-                wcount++;
             }
         }
     }
Signature · 1 line
2.17.1
#1 lore raw
Quoted 3 lines · Taylor Simpson

Some versions of clang will warn on this with -Wall Then, it will be an error with -Werror

I think this has already been fixed by commit 2bc6c79417b89c3306.

thanks
-- PMM

#2 lore raw
In reply to Taylor Simpson
Quoted 10 lines

-----Original Message-----
From: Taylor Simpson <[email protected]>
Sent: Thursday, January 5, 2023 10:24 AM
To: [email protected]; [email protected]
Cc: Taylor Simpson <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Brian Cain <[email protected]>; Matheus Bernardino (QUIC) <[email protected]>
Subject: [PATCH] linux-test.c: Remove unused but set variable

Quoted 2 lines

Some versions of clang will warn on this with -Wall Then, it will be an error with -Werror

This change landed with 9804dcd2719a44d90982e61d466213e522c854ef

https://github.com/qemu/qemu/commit/9804dcd2719a44d90982e61d466213e522c854ef

#3 lore raw
Quoted 20 lines

-----Original Message-----
From: Brian Cain
Sent: Thursday, January 5, 2023 11:10 AM
To: Taylor Simpson <[email protected]>; [email protected]; [email protected]
Cc: Taylor Simpson <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Matheus Bernardino (QUIC) <[email protected]>
Subject: RE: [PATCH] linux-test.c: Remove unused but set variable

Quoted 10 lines

-----Original Message-----
From: Taylor Simpson <[email protected]>
Sent: Thursday, January 5, 2023 10:24 AM
To: [email protected]; [email protected]
Cc: Taylor Simpson <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Brian Cain <[email protected]>; Matheus Bernardino (QUIC) <[email protected]>
Subject: [PATCH] linux-test.c: Remove unused but set variable

Quoted 4 lines
Quoted 2 lines

Some versions of clang will warn on this with -Wall Then, it will be an error with -Werror

This change landed with 9804dcd2719a44d90982e61d466213e522c854ef

Rather: the effective fix for this issue is present. Maybe the container registry was updated and you would see this problem when building commits older than 9804dcd2719a44d90982e61d466213e522c854ef with the new container?

Quoted 2 lines

https://github.com/qemu/qemu/commit/9804dcd2719a44d90982e61d466213
e522c854ef