This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/8] Simple -Wshadow=local fixes
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Tom Tromey <tom at tromey dot com>, <gdb-patches at sourceware dot org>
- Date: Wed, 3 Oct 2018 23:36:08 -0400
- Subject: Re: [PATCH 1/8] Simple -Wshadow=local fixes
- References: <20180923040814.27941-1-tom@tromey.com> <20180923040814.27941-2-tom@tromey.com>
On 2018-09-23 12:08 AM, Tom Tromey wrote:
> This fixes all the straightforward -Wshadow=local warnings in gdb. A
> few standard approaches are used here:
>
> * Renaming an inner (or outer, but more commonly inner) variable;
> * Lowering a declaration to avoid a clash;
> * Moving a declaration into a more inner scope to avoid a clash,
> including the special case of moving a declaration into a loop header.
>
> I did not consider any of the changes in this patch to be particularly
> noteworthy, though of course they should all still be examined.
I just noticed this new warning, introduced by this patch:
CXX mdebugread.o
/home/emaisin/src/binutils-gdb/gdb/mdebugread.c: In function ‘void parse_partial_symbols(minimal_symbol_reader&, objfile*)’:
/home/emaisin/src/binutils-gdb/gdb/mdebugread.c:3573:42: warning: ‘name’ may be used uninitialized in this function [-Wmaybe-uninitialized]
add_psymbol_to_list (name, strlen (name), 1,
^
Simon