Re: [Boost-bugs] [Boost C++ Libraries] #9378: g++ 4.7 -Wshadow warnings need attention

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9378: g++ 4.7 -Wshadow warnings need attention
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-03-18 22:32:34


#9378: g++ 4.7 -Wshadow warnings need attention
------------------------------------------+--------------------------
  Reporter: Tom Browder <tom.browder@…> | Owner: eric_niebler
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: xpressive
   Version: Boost 1.55.0 | Severity: Problem
Resolution: | Keywords:
------------------------------------------+--------------------------

Comment (by rmann@…):

 I'm not sure I agree it's "standard idiom." Just because it's legal code
 doesn't mean it's a good idea. It opens you up to subtle programming bugs
 that can be difficult to spot. We recently found a problem due to
 shadowing a variable, and so turned on -Wshadow. Now we get hundreds of
 warnings from Boost (and others) about shadowed variables, making it very
 difficult to spot our own (potential) errors.

 Much better programming style to avoid shadowing all together.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9378#comment:5>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:15 UTC