Opened 10 years ago

#7567 new Bugs

Shadow warnings in timer.hpp

Reported by: Kenneth Moreland <kmorel@…> Owned by: Beman Dawes
Milestone: To Be Determined Component: timer
Version: Boost 1.51.0 Severity: Cosmetic
Keywords: Cc: Beman Dawes

Description

This code

#include <boost/timer/timer.hpp>

int main(int, char *[]) { return 0; }

compiled with

gcc -I/path/to/boost -c -Wshadow test.cxx

produces several warnings about shadowed class members:

/opt/local/include/boost/timer/timer.hpp: In member function 'std::string boost::timer::cpu_timer::format(short int, const std::string&) const':
/opt/local/include/boost/timer/timer.hpp:74: warning: declaration of 'format' shadows a member of 'this'
/opt/local/include/boost/timer/timer.hpp: In constructor 'boost::timer::auto_cpu_timer::auto_cpu_timer(std::ostream&, short int, const std::string&)':
/opt/local/include/boost/timer/timer.hpp:103: warning: declaration of 'format' shadows a member of 'this'
/opt/local/include/boost/timer/timer.hpp:103: warning: declaration of 'places' shadows a member of 'this'
/opt/local/include/boost/timer/timer.hpp: In constructor 'boost::timer::auto_cpu_timer::auto_cpu_timer(std::ostream&, const std::string&)':
/opt/local/include/boost/timer/timer.hpp:107: warning: declaration of 'format' shadows a member of 'this'

This was compile on Mac Snow Leopard, gcc 4.2.1 with the boost distribution from MacPorts (although I doubt any of that matters).

Change History (0)

Note: See TracTickets for help on using tickets.