Boost C++ Libraries: Ticket #3846: Boost.Interprocess getline(istream, basic_string, CharT) contains duplicated variable int c1 https://svn.boost.org/trac10/ticket/3846 <p> As of Boost 1.41.0 (and in SVN as of today, 18 Jan 2010), the Boost.Interprocess container library implements </p> <blockquote> <p> template &lt;...&gt; std::istream &amp;getline(std::istream&amp;, basic_string&lt;...&gt; &amp;, CharT) </p> </blockquote> <p> in </p> <blockquote> <p> boost/interprocess/containers/container/string.hpp </p> </blockquote> <p> with the following snippet: </p> <p> Line 2276: </p> <blockquote> <p> int c1; while (nread &lt; s.max_size()) { </p> <blockquote> <p> int c1 = buf-&gt;sbumpc(); </p> </blockquote> <p> : } </p> </blockquote> <p> 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: </p> <p> --- /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 @@ </p> <blockquote> <p> std::basic_streambuf&lt;CharT, Traits&gt;* buf = is.rdbuf(); s.clear(); </p> </blockquote> <ul><li> int c1; </li></ul><blockquote> <p> while (nread &lt; s.max_size()) { </p> <blockquote> <p> int c1 = buf-&gt;sbumpc(); if (Traits::eq_int_type(c1, Traits::eof())) { </p> </blockquote> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3846 Trac 1.4.3 Ion Gaztañaga Thu, 26 Aug 2010 10:17:09 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/3846#comment:1 https://svn.boost.org/trac10/ticket/3846#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.42.0</span> → <span class="trac-field-new">Boost-1.45.0</span> </li> </ul> <p> Fixed for Boost 1.45 in release branch </p> Ticket