This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: is '-Wshadow' too chatty?


>>>>> "Joseph" == Joseph S Myers <jsm28@cam.ac.uk> writes:

> On 30 Dec 2000, Jason Merrill wrote:
>> >>>>> "Eyal" == Eyal Lebedinsky <eyal@eyal.emu.id.au> writes:
>> 
>> > These -Wshadow warnings are very usefull, I started using it now.
>> > A problem that I see is that it produces diagnostics even inside
>> > a function declaration prototype. The fact is that there is no
>> > risk is such shadowing since the argument names (optional in a
>> > declaration) go out of scope at the end of the declaration.
>> 
>> > I suggest the diagnostic be supressed in this situation. Does this
>> > sound proper?
>> 
>> Makes sense to me.

> However, if the parameter name with function prototype scope gets used in
> that scope (e.g. as a dimension of an array parameter), then the warning
> should be retained - though it is fairly useless when the parameter name
> is entirely unused.

True.

Jason

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