Boost logo

Boost :

From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2006-03-20 05:02:41


Boost 1.33.1 contains a number of constructs which cause warnings when
compiled with GCC 3.4.2 (and other versions) using some warning flags. The
majority of warnings are -Wshadow warnings and are easily correctable. One
is a C cast that should be written as a const_cast. The most severe one is
an omission of "const" that produces a warning under -Wcast-qual.

I maintain a local patch that fixes these things (as otherwise I can't use
these warning flags on my own code), but it'd be really nice if they were
fixed in Boost mainline. The C cast and -Wcast-qual problems have obvious
fixes. My fixes for the -Wshadow warnings involve prepending x_ to variable
names, since I don't need to be inventive. Better names should probably be

I reported these problems against 1.33.0, but they appeared unchanged in

My patch is here:

* The following files have shadow warnings:

* This file has shadow warnings, and a redundant typedef that causes a
shadow warning:

* This file has a C cast that should be a const_cast:

* This file omits a "const", which causes a nasty -Wcast-qual warning:

The omission of the const is not intentional, if you look at the template
The warning that this generates is here:

* This file says "bash" when it should say "sh". MSYS bash appears under
"sh" but not "bash". This is really minor, since in 1.33.1 I don't even need
to execute, but it'd be nice to have it fixed.

Finally, Boost Regex's gcc.mak causes problems for MinGW MSYS. It really
doesn't like trailing slashes. The patch for this is here:

I believe that other systems don't require trailing slashes, but I'm not
sure. (I am only concerned with the -I../../../ here; the optimization
settings are purely for myself and should not be put into mainline.)

Stephan T. Lavavej

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