[ob] rename local variable in break_command_really.

Tom Tromey tromey@redhat.com
Thu Jun 11 20:37:00 GMT 2009


>>>>> "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



More information about the Gdb-patches mailing list