Boost logo

Boost :

From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2006-03-25 21:58:30


I downloaded RC_1_34_0 from CVS on 20060324 and found -Wshadow and
-Wcast-qual warnings (from GCC 3.4.2) in three files.

My patch is here:

This patch supersedes my patch for 1.33.1; I verified that Jeff Garland's
and John Maddock's date-time and regex fixes, respectively, work in
RC_1_34_0 (thanks again!), and found that the C cast in
boost/range/detail/implementation_help.hpp was fixed 7 months ago.

* boost/date_time/gregorian/gregorian_io.hpp

This file contains several instances of a smaller-scope output_itr shadowing
a larger-scope output_itr. My local patch renames each larger-scope
output_itr to big_output_itr. (The larger-scope variable is the safer one to
rename in cases of local-local shadowing.)

* boost/format/format_implementation.hpp

This file has contained shadowing since at least 1.33.0.

* boost/token_iterator.hpp

This file has lacked a "const" since at least 1.33.0, which causes a *nasty*
-Wcast-qual warning:

This warning is nasty because its cause isn't immediately obvious.

Can the appropriate maintainers please take a look at these patches? It'd be
really nice if people could use -Wshadow and -Wcast-qual with Boost without
having to patch it first.

Stephan T. Lavavej

Boost list run by bdawes at, gregod at, cpdaniel at, john at