This is the mail archive of the gdb-patches@sources.redhat.com 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: RFC: ARM simulator coredump


Hi Andrew,

> > +      {
> >> +	ARMword temp;
> > There is no need to declare a 'temp' variable here.  There is a
> > variable of the same type and name declared at the top of the
> > function, and it is no longer being used by this point.
> 
> Er, perhaphs here.  In general, keeping declarations as local as
> possible is a good thing :-)

True, but in this case the new variable was shadowing a local variable
declared at the function scope.  Either it should have been given a
new name, or since it was just being used as a temporary placeholder
the function scoped variable should have been reused.

Cheers
        Nick


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