Modify

Opened 6 years ago

Closed 6 years ago

#5439 closed Bugs (fixed)

warning on dynamic bitset

Reported by: lieven.de.cock@… Owned by: jsiek
Milestone: To Be Determined Component: dynamic_bitset
Version: Boost 1.47.0 Severity: Cosmetic
Keywords: Cc:

Description

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

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by marshall

(In [71505]) Applied patch; Refs #5439

comment:2 Changed 6 years ago by marshall

  • Resolution set to fixed
  • Status changed from new to closed

(In [72331]) Merge fixes to release; Fixes #5439

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain jsiek.
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.