Avoid shadowing in fdwalk
authorTom Tromey <tom@tromey.com>
Sun, 22 Apr 2018 16:11:32 +0000 (10:11 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 5 Oct 2018 04:51:48 +0000 (22:51 -0600)
-Wshadow=local caught this buglet.  fdwalk redeclares "result" in the
inner scope, meaning that this function will always return 0, even on
error.

gdb/ChangeLog
2018-10-04  Tom Tromey  <tom@tromey.com>

* common/filestuff.c (fdwalk): Remove inner declaration of
"result".

gdb/ChangeLog
gdb/common/filestuff.c

index 9a8390b7087fcffa0e0e8132c6842a4dbfdfa1cb..42c55edf4c80c49cdd1267bc8a314dfb38de56cc 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-04  Tom Tromey  <tom@tromey.com>
+
+       * common/filestuff.c (fdwalk): Remove inner declaration of
+       "result".
+
 2018-10-04  Tom Tromey  <tom@tromey.com>
 
        * msp430-tdep.c (msp430_push_dummy_call): Rename inner
index fa10165a7cac8739964cb953dc433f896e684c4c..dfd86f9fbbd8192d7ade8f3fac2359638b36fa7e 100644 (file)
@@ -80,7 +80,6 @@ fdwalk (int (*func) (void *, int), void *arg)
        {
          long fd;
          char *tail;
-         int result;
 
          errno = 0;
          fd = strtol (entry->d_name, &tail, 10);
This page took 0.031571 seconds and 4 git commands to generate.