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: [ob] rename local variable in break_command_really.


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


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