Boost C++ Libraries: Ticket #5439: warning on dynamic bitset https://svn.boost.org/trac10/ticket/5439 <p> When code is being compiled with the gcc compiler option "-Wshadow" [warn whenever a local variable shadows another local variable, parameter or global variable or whenever a build-in function is shadowed ...] we get a warning. </p> <p> dynamic_bitset.hpp </p> <p> in the method : template &lt;typename Block, typename Allocator&gt; unsigned long dynamic_bitset&lt;Block, Allocator&gt;:: to_ulong() const </p> <p> at the line (1111) : </p> <pre class="wiki"> const size_type max_size = (std::min)(m_num_bits, static_cast&lt;size_type&gt;(ulong_width)); const size_type last_block = block_index( max_size - 1 ); </pre><p> The max_size local variable shadows the max_size method. </p> <p> Solution is trivial , rename the local variable : max_size -&gt; maximum_size </p> <pre class="wiki"> const size_type maximum_size = (std::min)(m_num_bits, static_cast&lt;size_type&gt;(ulong_width)); const size_type last_block = block_index( maximum_size - 1 ); </pre><p> kind regards, Lieven </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5439 Trac 1.4.3 Marshall Clow Tue, 26 Apr 2011 14:41:53 GMT <link>https://svn.boost.org/trac10/ticket/5439#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5439#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/71505" title="Applied patch; Refs #5439">[71505]</a>) Applied patch; Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5439" title="#5439: Bugs: warning on dynamic bitset (closed: fixed)">#5439</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Wed, 01 Jun 2011 15:59:06 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5439#comment:2 https://svn.boost.org/trac10/ticket/5439#comment:2 <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> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/72331" title="Merge fixes to release; Fixes #5439">[72331]</a>) Merge fixes to release; Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5439" title="#5439: Bugs: warning on dynamic bitset (closed: fixed)">#5439</a> </p> Ticket