[Boost-bugs] [Boost C++ Libraries] #5439: warning on dynamic bitset

Subject: [Boost-bugs] [Boost C++ Libraries] #5439: warning on dynamic bitset
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-08 07:02:26


#5439: warning on dynamic bitset
---------------------------------------+------------------------------------
 Reporter: lieven.de.cock@… | Owner: jsiek
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: dynamic_bitset
  Version: Boost 1.47.0 | Severity: Cosmetic
 Keywords: |
---------------------------------------+------------------------------------
 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.

 dynamic_bitset.hpp

 in the method :
 template <typename Block, typename Allocator>
 unsigned long dynamic_bitset<Block, Allocator>::
 to_ulong() const

 at the line (1111) :

 {{{
   const size_type max_size =
             (std::min)(m_num_bits, static_cast<size_type>(ulong_width));

   const size_type last_block = block_index( max_size - 1 );
 }}}

 The max_size local variable shadows the max_size method.

 Solution is trivial , rename the local variable : max_size -> maximum_size

 {{{
   const size_type maximum_size =
             (std::min)(m_num_bits, static_cast<size_type>(ulong_width));

   const size_type last_block = block_index( maximum_size - 1 );
 }}}


 kind regards,
 Lieven

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