[Boost-bugs] [Boost C++ Libraries] #3216: variable shadowing with possibly bad implications

Subject: [Boost-bugs] [Boost C++ Libraries] #3216: variable shadowing with possibly bad implications
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-06-24 14:28:06


#3216: variable shadowing with possibly bad implications
---------------------------------------------+------------------------------
 Reporter: Arne Juul <arnej@…> | Owner:
     Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: None
  Version: Boost 1.39.0 | Severity: Problem
 Keywords: |
---------------------------------------------+------------------------------
 we usually compile our code with -Wshadow using gcc; this usually
 reports lots of shadowing in the boost headers. Most of this is
 just annoying noise, but I've found one issue in the file
 boost_1_39_0/boost/asio/detail/reactive_socket_service.hpp
 where the name "ec" is used first as a reference parameter and
 then redeclared and used as a local variable. It seems to me
 that some of the uses after this point may have intended to
 save state back in the reference variable, so this code should
 be carefully reviewed. At the very least, some better variable
 names should be chosen so it's clear what the intended logic was.

 I have a patch that renames both "ec" variables without changing
 the semantics of the code (attached).

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3216>
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:00 UTC