SLUG Mailing List Archives
Re: [SLUG] -Wshadow
- To: Erik de Castro Lopo <erikd-slug@xxxxxxxxxxxxx>
- Subject: Re: [SLUG] -Wshadow
- From: Benno <benjl@xxxxxxxxxxxxxxx>
- Date: Tue, 24 May 2005 22:56:09 +1000
- Cc: slug@xxxxxxxxxxx
- User-agent: Mutt/1.5.6+20040907i
On Tue May 24, 2005 at 22:41:27 +1000, Erik de Castro Lopo wrote:
>> Does anyone want to convince me otherwise?
>I have seen bugs in GNU Arch and Ecartis (mailing list manager)
>that were caused by a variable in an outer scope being shadowed
>in an inner scope.
>If -Wshadow catches on single bug its worth living with or
>rather working around any spurious warnings.
>I wouldn't cut C code without it.
My main work around for this was having function declarations in
header files not specify the name of arguments, to avoid potential
spurious clashes. However this means that I can't use doxygen, which
relies on the name of arguments to document the functions.
Maybe I will try and configure splint to check this error in a way
that doesn't generate the spurious warnings.