Modify

Ticket #3846 (closed Patches: fixed)

Opened 4 years ago

Last modified 4 years ago

Boost.Interprocess getline(istream, basic_string, CharT) contains duplicated variable int c1

Reported by: wlam@… Owned by: igaztanaga
Milestone: Boost 1.45.0 Component: interprocess
Version: Boost 1.41.0 Severity: Cosmetic
Keywords: Cc: Wang Lam <wlam@…>

Description

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())) {

Attachments

Change History

comment:1 Changed 4 years ago by igaztanaga

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from Boost 1.42.0 to Boost-1.45.0

Fixed for Boost 1.45 in release branch

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.