Opened 13 years ago

Closed 13 years ago

#3329 closed Bugs (fixed)

Boost::Statechart: Shadow Variables Cause Warnings/Errors When Headers Are Not in System Path

Reported by: gerickson@… Owned by: Andreas Huber
Milestone: Boost 1.43.0 Component: statechart
Version: Boost 1.39.0 Severity: Problem
Keywords: Cc:

Description

I've recently added Boost 1.39.0 to an Xcode 3.1.3 project with the following warnings enabled in GCC/G++ 4.0.1:

-Werror -Wreturn-type -Wunused-function -Wunused-label -Wunused-variable -Wshadow

Unfortunately, when boost is not installed in a "system" path--as is the case here--unused and shadow variable warnings cause the build to fail when warnings are treated as errors.

The included header is:

boost/statechart/result.hpp

To test and fix, I isolated with:

printf "#include <${BoostHeader}>\nint main(void) { return 0; }" | /Developer/usr/bin/gcc-4.0 -x c++ -Wall -Wshadow -Werror -o test -I${BoostRoot}/boost/include -

The patch to address this is attached.

Because this problem seems to come up frequently in all Boost subsystems, perhaps there is a way -Wshadow and -Wall can be forced for all unit tests?

Attachments (2)

boost-sc.patch (433 bytes ) - added by gerickson@… 13 years ago.
Patch for Boost::Statechart -Wshadow Errors
boost-sc (revised).patch (478 bytes ) - added by gerickson@… 13 years ago.
Revised patch for Boost::Statechart -Wshadow Errors

Download all attachments as: .zip

Change History (5)

by gerickson@…, 13 years ago

Attachment: boost-sc.patch added

Patch for Boost::Statechart -Wshadow Errors

by gerickson@…, 13 years ago

Attachment: boost-sc (revised).patch added

Revised patch for Boost::Statechart -Wshadow Errors

comment:1 by Andreas Huber, 13 years ago

Status: newassigned

comment:2 by Andreas Huber, 13 years ago

Milestone: To Be DeterminedBoost 1.43.0

comment:3 by Andreas Huber, 13 years ago

Resolution: fixed
Status: assignedclosed

(In [61047]) Fixes #3329. Thanks for the report!

Note: See TracTickets for help on using tickets.