]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdbserver: remove unused variable
authorEnze Li <enze.li@hotmail.com>
Mon, 11 Jul 2022 12:53:48 +0000 (20:53 +0800)
committerEnze Li <enze.li@hotmail.com>
Wed, 13 Jul 2022 12:10:18 +0000 (20:10 +0800)
When building with clang 15, I got this error:

  CXX    server.o
server.cc:2985:10: error: variable 'new_argc' set but not used [-Werror,-Wunused-but-set-variable]
  int i, new_argc;
             ^
Remove the unused variable to eliminate the error.

Tested by rebuilding on x86_64-linux with clang 15.

gdbserver/server.cc

index f9c02a9c6dacbae759911364f02179e17ddcc665..c619206d5d2d5f7af85b2c9c15f3ef4b0d63080c 100644 (file)
@@ -2982,14 +2982,10 @@ handle_v_run (char *own_buf)
   char *p, *next_p;
   std::vector<char *> new_argv;
   char *new_program_name = NULL;
-  int i, new_argc;
+  int i;
 
-  new_argc = 0;
   for (p = own_buf + strlen ("vRun;"); p && *p; p = strchr (p, ';'))
-    {
-      p++;
-      new_argc++;
-    }
+    p++;
 
   for (i = 0, p = own_buf + strlen ("vRun;"); *p; p = next_p, ++i)
     {