[Boost-bugs] [Boost C++ Libraries] #3846: Boost.Interprocess getline(istream, basic_string, CharT) contains duplicated variable int c1

Subject: [Boost-bugs] [Boost C++ Libraries] #3846: Boost.Interprocess getline(istream, basic_string, CharT) contains duplicated variable int c1
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-01-19 05:21:25


#3846: Boost.Interprocess getline(istream, basic_string, CharT) contains
duplicated variable int c1
-----------------------------+----------------------------------------------
 Reporter: wlam@… | Owner: igaztanaga
     Type: Patches | Status: new
Milestone: Boost 1.42.0 | Component: interprocess
  Version: Boost 1.41.0 | Severity: Cosmetic
 Keywords: |
-----------------------------+----------------------------------------------
 As of Boost 1.41.0 (and in SVN as of today, 18 Jan 2010), the
 Boost.Interprocess container library implements

   template <...>
   std::istream &getline(std::istream&, basic_string<...> &, CharT)

 in

   boost/interprocess/containers/container/string.hpp

 with the following snippet:

 Line 2276:
       int c1;
       while (nread < s.max_size()) {
          int c1 = buf->sbumpc();
       :
       }

 The outer declaration of c1 can trigger an (apparently correct) unused-
 variable warning in gcc. If the declaration is indeed unnecessary (e.g.,
 is not some compiler-bug workaround), it looks trivial to remove:

 ---
 /home/wlam/boost_1_41_0/boost/interprocess/containers/container/string.hpp
 2009-10-15 11:46:26.000000000 -0700
 +++ ../boost/interprocess/containers/container/string.hpp 2010-01-18
 20:29:36.635619313 -0800
 @@ -2273,7 +2273,6 @@
        std::basic_streambuf<CharT, Traits>* buf = is.rdbuf();
        s.clear();

 - int c1;
        while (nread < s.max_size()) {
           int c1 = buf->sbumpc();
           if (Traits::eq_int_type(c1, Traits::eof())) {

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