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: [RFC] Compile GDB with -Wshadow?


>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

>> I wish the compiler would warn us about things like this...  The patch
>> looks correct to me, but I will let Ken and Ulrich take a look. Perhaps
>> they'll be able to suggest a more specific name than `length2' ;-).

Joel> Howzabout we add -Wshadow to the list of warning compiler switches
Joel> for GCC? Something like this (untested for now, just to give an idea
Joel> for this discussion)...

-Wshadow also warns about a local variable whose name clashes with a
function.  I find this to be a bit unfriendly.

I wish GCC had a variant of -Wshadow where clashes with functions were
only reported if the shadowing variable had pointer-to-function type.

That said, I don't really mind if we have to change some local variable
names around to satisfy various platforms.  It is just a lot of work.

Tom


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