From: David Abrahams (dave_at_[hidden])
Date: 2003-11-19 13:39:34
"John Maddock" <john_at_[hidden]> writes:
> Here's my take on the issue based on my experience with Boost.regex:
> The regex sources now compile cleanly with -Wshadow, during the fix I found:
> A couple of places where third party compiler-workarounds introduced
> unneeded local variables, the code was cleaned up marginally by fixing
> the -Wshadow warnings.
> A couple of places where lack of imagination on variable naming on my part
> lead to member function arguments with the same name as class members, the
> code is probably cleaner as a result of fixing these.
> A lot of "busy body" warnings from the reuse of common scope-variable
> names - names of counters (i and j) and characters (c), come in for a lot of
> flack here.
> The Boost.regex test code still does not compile cleanly with -Wshadow, and
> it's not going to:
> The concept checking code introduces hundreds of lines of warnings.
> Global variables in the test code sources "conflict" with the names of
> function parameters - I started fixing these by replacing names like "flags"
> with "arg_flags", but in the end I gave up, and actually undid the changes I
> had made, because IMO they only served to further obfuscate the code.
The "quick fix" for those is to stick the test stuff in a namespace.
I wonder if an unnamed namespace is enough?
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk