This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: is '-Wshadow' too chatty?
- To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Subject: Re: is '-Wshadow' too chatty?
- From: Jason Merrill <jason at redhat dot com>
- Date: 31 Dec 2000 18:02:29 +0000
- Cc: Eyal Lebedinsky <eyal at eyal dot emu dot id dot au>, gcc-patches list <gcc-patches at gcc dot gnu dot org>
- References: <Pine.LNX.4.30.0012301737260.22583-100000@kern.srcf.societies.cam.ac.uk>
>>>>> "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