From: Tom Tromey Date: Sun, 22 Apr 2018 16:11:32 +0000 (-0600) Subject: Avoid shadowing in fdwalk X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8c888478d517a39d8b0104857d573e47620a3d1;p=binutils-gdb.git Avoid shadowing in fdwalk -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 * common/filestuff.c (fdwalk): Remove inner declaration of "result". --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9a8390b7087..42c55edf4c8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-10-04 Tom Tromey + + * common/filestuff.c (fdwalk): Remove inner declaration of + "result". + 2018-10-04 Tom Tromey * msp430-tdep.c (msp430_push_dummy_call): Rename inner diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c index fa10165a7ca..dfd86f9fbbd 100644 --- a/gdb/common/filestuff.c +++ b/gdb/common/filestuff.c @@ -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);