diff mbox series

linux-test.c: Remove unused but set variable

Message ID 20230105162348.16725-1-tsimpson@quicinc.com
State New
Headers show
Series linux-test.c: Remove unused but set variable | expand

Commit Message

Taylor Simpson Jan. 5, 2023, 4:23 p.m. UTC
Some versions of clang will warn on this with -Wall
Then, it will be an error with -Werror

Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
---
 tests/tcg/multiarch/linux/linux-test.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Peter Maydell Jan. 5, 2023, 4:28 p.m. UTC | #1
On Thu, 5 Jan 2023 at 16:24, Taylor Simpson <tsimpson@quicinc.com> wrote:
>
> 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
Brian Cain Jan. 5, 2023, 5:09 p.m. UTC | #2
> -----Original Message-----
> From: Taylor Simpson <tsimpson@quicinc.com>
> Sent: Thursday, January 5, 2023 10:24 AM
> To: qemu-devel@nongnu.org; alex.bennee@linaro.org
> Cc: Taylor Simpson <tsimpson@quicinc.com>; richard.henderson@linaro.org;
> philmd@linaro.org; ale@rev.ng; anjo@rev.ng; Brian Cain
> <bcain@quicinc.com>; Matheus Bernardino (QUIC)
> <quic_mathbern@quicinc.com>
> Subject: [PATCH] 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

This change landed with 9804dcd2719a44d90982e61d466213e522c854ef

https://github.com/qemu/qemu/commit/9804dcd2719a44d90982e61d466213e522c854ef
Brian Cain Jan. 5, 2023, 5:11 p.m. UTC | #3
> -----Original Message-----
> From: Brian Cain
> Sent: Thursday, January 5, 2023 11:10 AM
> To: Taylor Simpson <tsimpson@quicinc.com>; qemu-devel@nongnu.org;
> alex.bennee@linaro.org
> Cc: Taylor Simpson <tsimpson@quicinc.com>; richard.henderson@linaro.org;
> philmd@linaro.org; ale@rev.ng; anjo@rev.ng; Matheus Bernardino (QUIC)
> <quic_mathbern@quicinc.com>
> Subject: RE: [PATCH] linux-test.c: Remove unused but set variable
> 
> > -----Original Message-----
> > From: Taylor Simpson <tsimpson@quicinc.com>
> > Sent: Thursday, January 5, 2023 10:24 AM
> > To: qemu-devel@nongnu.org; alex.bennee@linaro.org
> > Cc: Taylor Simpson <tsimpson@quicinc.com>; richard.henderson@linaro.org;
> > philmd@linaro.org; ale@rev.ng; anjo@rev.ng; Brian Cain
> > <bcain@quicinc.com>; Matheus Bernardino (QUIC)
> > <quic_mathbern@quicinc.com>
> > Subject: [PATCH] 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
> 
> 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?

> https://github.com/qemu/qemu/commit/9804dcd2719a44d90982e61d466213
> e522c854ef
diff mbox series

Patch

diff --git a/tests/tcg/multiarch/linux/linux-test.c b/tests/tcg/multiarch/linux/linux-test.c
index 5a2a4f2258..10943d5310 100644
--- a/tests/tcg/multiarch/linux/linux-test.c
+++ b/tests/tcg/multiarch/linux/linux-test.c
@@ -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++;
             }
         }
     }