Boost C++ Libraries: Ticket #6074: warnings-as-errors not usable with Boost.test in release mode https://svn.boost.org/trac10/ticket/6074 <p> Ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3598" title="#3598: Patches: Patch for warnings in Boost.Test (closed: fixed)">#3598</a> reported patches for allowing warnings-as-errors to be used. </p> <p> I note that the current trunk version has (possibly new) warnings in release mode (debug is OK) that prevent warnings-as-errors from being used. </p> <p> unit_test_parameters.cpp i:\boost-trunk\boost\test\utils\named_params.hpp(73) : error C2220: warning treated as error - no 'object' file generated i:\boost-trunk\boost\test\utils\named_params.hpp(73) : warning C4702: unreachable code </p> <p> compile-c-c++ i:\boost-trunk\bin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\link-static\threading-multi\decorator.obj decorator.cpp i:\boost-trunk\boost\test\utils\named_params.hpp(77) : error C2220: warning treated as error - no 'object' file generated i:\boost-trunk\boost\test\utils\named_params.hpp(77) : warning C4702: unreachable code </p> <p> execution_monitor.cpp i:\boost-trunk\boost\test\impl\execution_monitor.ipp(1040) : error C2220: warning treated as error - no 'object' file generated i:\boost-trunk\boost\test\impl\execution_monitor.ipp(1040) : warning C4702: unreachable code </p> <p> It would be nice if either </p> <p> 1 These can be coded round. </p> <p> 2 The docs could be updated to warn that warnings-as-errors is not supported. </p> <p> 3 Or if there is some other way round this? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6074 Trac 1.4.3 Gennadiy Rozental Mon, 05 Nov 2012 10:29:36 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6074#comment:1 https://svn.boost.org/trac10/ticket/6074#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed in trunk by 81197 </p> Ticket Valentin Shtronda <valiko.ua@…> Mon, 04 Mar 2013 18:01:29 GMT <link>https://svn.boost.org/trac10/ticket/6074#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6074#comment:2</guid> <description> <p> Hi rogeeff, </p> <p> I checked out trunk and still see the following warnings when building release in VS2012 (original reporter talked about VS2010): </p> <pre class="wiki">boost\test\utils\named_params.hpp(75): warning C4702: unreachable code boost\test\utils\named_params.hpp(79): warning C4702: unreachable code boost\test\utils\named_params.hpp(87): warning C4702: unreachable code </pre><p> I got rid of them by removing the code after throwing exception (not sure if it's OK for other compilers): </p> <p> Against trunk revision 81197: </p> <pre class="wiki">line 75: { report_access_to_invalid_parameter(true); /*static T* v = 0; return *v;*/ } line 79: { report_access_to_invalid_parameter(true); /*static typename remove_reference&lt;T&gt;::type* v = 0; return *v;*/ } line 83: { report_access_to_invalid_parameter(true); /*return nil();*/ } line 87: { report_access_to_invalid_parameter(true); /*return nil();*/ } line 91: { report_access_to_invalid_parameter(true); /*return nil();*/ } </pre><p> Against boost 1.53: </p> <pre class="wiki">line 74: { report_access_to_invalid_parameter(); /*static T* v = 0; return *v;*/ } line 78: { report_access_to_invalid_parameter(); /*static typename remove_reference&lt;T&gt;::type* v = 0; return *v;*/ } line 82: { report_access_to_invalid_parameter(); /*return nil();*/ } line 86: { report_access_to_invalid_parameter(); /*return nil();*/ } line 90: { report_access_to_invalid_parameter(); /*return nil();*/ } </pre> </description> <category>Ticket</category> </item> <item> <author>Valentin Shtronda <valiko.ua@…></author> <pubDate>Tue, 05 Mar 2013 15:03:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6074#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6074#comment:3</guid> <description> <p> The fix above breaks the build in debug mode :) I fixed both modes by removing function report_access_to_invalid_parameter() and throwing exception directly in 6 occurrences (including line 282/281): </p> <pre class="wiki">{ throw access_to_invalid_parameter(); } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Tue, 07 Jul 2015 08:29:48 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/6074#comment:4 https://svn.boost.org/trac10/ticket/6074#comment:4 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.59.0</span> </li> </ul> <p> I believe this is fixed. </p> Ticket