This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/8] Simple -Wshadow=local fixes


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]