This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [ob] rename local variable in break_command_really.
- From: Tom Tromey <tromey at redhat dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 11 Jun 2009 14:35:21 -0600
- Subject: Re: [ob] rename local variable in break_command_really.
- References: <200906111959.07108.pedro@codesourcery.com>
- Reply-to: tromey at redhat dot com
>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
Pedro> I was doing some local debug changes to break_command_really, that
Pedro> were introducing a usage of the ALL_BREAKPOINTS macro, and
Pedro> mysteriously, the result was failing to compile. Turns out this
Pedro> function declares a variable named breakpoint_chain, which is the
Pedro> same name of the global ALL_BREAKPOINTS references...
Pedro> I've checked this in to hopefully avoid such headaches to
Pedro> someone else (maybe me!) in the future.
Out of curiosity I tried a build with -Wshadow. That gives more than
500 errors. Unfortunately a lot of them (IMO) are somewhat bogus :(,
e.g., a warn about a local named "index" clashing with the global
function of the same name.
We do seem to have an uncommonly large number of local declarations
shadowing other locals though, e.g.:
../../src/gdb/osdata.c:331: error: declaration of âold_chainâ shadows a previous local
../../src/gdb/osdata.c:286: error: shadowed declaration is here
Tom