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: Refactor tdep-i386.c to fix all -Wshadow warnings


> From: Tom Tromey <tromey@redhat.com>
> Date: Mon, 06 Aug 2012 08:23:11 -0600
> 
> >>>>> "Goncalo" == Goncalo Gomes <goncalo@promisc.org> writes:
> 
> Goncalo> The attached patch fixes all warnings in tdep-i386.c resulting from
> Goncalo> enabling shadow warnings in gcc. As this is my first contribution to
> Goncalo> GDB, I decided to keep it short to a single file to obtain feedback.
> 
> Just a friendly word of warning -- this is arguably the worst project to
> pick of all the things on the project page (though unfortunately there
> is more than one stinker on there).  It's been attempted a couple of
> times, had always lead to a lot of contention, etc.
> 
> That doesn't mean it can't be done, just that you ought to expect it to
> be a pain.
> 
> Last time this came up, I think the conclusion was that we'd prefer it
> if we could get warnings only for some kinds of shadowing, but not all
> kinds.  There was a sense that warnings for shadowing of 'index' was not
> very useful.  I remember some discussion of checking for a GCC change in
> gdb's configure, but I don't remember the details any more.  They're in
> the archives.

Right.  In particular the case where a local variable "shadows" a
global function.  Until GCC stops warning about those cases I think we
should leave the -Wshadow issue alone.


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