Boost C++ Libraries: Ticket #3329: Boost::Statechart: Shadow Variables Cause Warnings/Errors When Headers Are Not in System Path https://svn.boost.org/trac10/ticket/3329 <p> 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: </p> <p> -Werror -Wreturn-type -Wunused-function -Wunused-label -Wunused-variable -Wshadow </p> <p> 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. </p> <p> The included header is: </p> <p> boost/statechart/result.hpp </p> <p> To test and fix, I isolated with: </p> <p> printf "#include &amp;lt;${<a class="missing wiki">BoostHeader</a>}&amp;gt;\nint main(void) { return 0; }" | /Developer/usr/bin/gcc-4.0 -x c++ -Wall -Wshadow -Werror -o test -I${<a class="missing wiki">BoostRoot</a>}/boost/include - </p> <p> The patch to address this is attached. </p> <p> 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? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3329 Trac 1.4.3 gerickson@… Sun, 09 Aug 2009 23:09:25 GMT attachment set https://svn.boost.org/trac10/ticket/3329 https://svn.boost.org/trac10/ticket/3329 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-sc.patch</span> </li> </ul> <p> Patch for Boost::Statechart -Wshadow Errors </p> Ticket gerickson@… Sun, 09 Aug 2009 23:15:08 GMT attachment set https://svn.boost.org/trac10/ticket/3329 https://svn.boost.org/trac10/ticket/3329 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-sc (revised).patch</span> </li> </ul> <p> Revised patch for Boost::Statechart -Wshadow Errors </p> Ticket Andreas Huber Sun, 04 Apr 2010 09:09:23 GMT status changed https://svn.boost.org/trac10/ticket/3329#comment:1 https://svn.boost.org/trac10/ticket/3329#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Andreas Huber Sun, 04 Apr 2010 09:10:43 GMT milestone changed https://svn.boost.org/trac10/ticket/3329#comment:2 https://svn.boost.org/trac10/ticket/3329#comment:2 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.43.0</span> </li> </ul> Ticket Andreas Huber Sun, 04 Apr 2010 16:27:49 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3329#comment:3 https://svn.boost.org/trac10/ticket/3329#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/61047" title="Fixes #3329. Thanks for the report!">[61047]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3329" title="#3329: Bugs: Boost::Statechart: Shadow Variables Cause Warnings/Errors When Headers ... (closed: fixed)">#3329</a>. Thanks for the report! </p> Ticket