Boost C++ Libraries: Ticket #2390: [patch] fix gcc-4.3 "unused" warning in floating_point_comparison https://svn.boost.org/trac10/ticket/2390 <p> Using -Wall -Werror under gcc-4.3, compilation of floating_point_comparison can fail with a "defined but not used" warning. </p> <p> The attached patch against <a class="changeset" href="https://svn.boost.org/trac10/changeset/49167" title="Started moving files into the boost and boost::graphs namespace. This ...">r49167</a> fixes this warning. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2390 Trac 1.4.3 Bryan Silverthorn <bcs26@…> Tue, 07 Oct 2008 19:17:32 GMT attachment set https://svn.boost.org/trac10/ticket/2390 https://svn.boost.org/trac10/ticket/2390 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">float_comparison_unused.patch</span> </li> </ul> <p> patch against <a class="changeset" href="https://svn.boost.org/trac10/changeset/49167" title="Started moving files into the boost and boost::graphs namespace. This ...">r49167</a> </p> Ticket Jürgen Hunold Thu, 06 Nov 2008 20:48:05 GMT attachment set https://svn.boost.org/trac10/ticket/2390 https://svn.boost.org/trac10/ticket/2390 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">floating_point_comparison.hpp.diff</span> </li> </ul> <p> Improved patch for all gcc-4.3 warnings </p> Ticket Jürgen Hunold Thu, 06 Nov 2008 20:58:45 GMT keywords set https://svn.boost.org/trac10/ticket/2390#comment:1 https://svn.boost.org/trac10/ticket/2390#comment:1 <ul> <li><strong>keywords</strong> test floating point gcc 4.3 warnings added </li> </ul> <p> I constructed an improved patch based on the ideas of Steven Watanabe for check_is_close and check_is_small. </p> <table class="wiki"> <tr>And added a patch from John Maddock to add explicit parenthesis around potentially ambigous &amp;&amp; and </tr></table> <p> The mailing list thread starts with: <a class="ext-link" href="http://lists.boost.org/Archives/boost/2008/10/143756.php"><span class="icon">​</span>http://lists.boost.org/Archives/boost/2008/10/143756.php</a> I've tested the patch with gcc-4.3.2 on SuSE-Linux 11 and msvc-9.0. </p> Ticket Gennadiy Rozental Fri, 21 Nov 2008 23:02:24 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2390#comment:2 https://svn.boost.org/trac10/ticket/2390#comment:2 <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> Ticket Jürgen Hunold Tue, 25 Nov 2008 08:53:31 GMT attachment set https://svn.boost.org/trac10/ticket/2390 https://svn.boost.org/trac10/ticket/2390 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">floating_point_comparison.hpp.2.diff</span> </li> </ul> <p> Patch to add missing const qualifiers </p> Ticket Jürgen Hunold Tue, 25 Nov 2008 08:59:20 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/2390#comment:3 https://svn.boost.org/trac10/ticket/2390#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Gennadiy, thanks for fixing this. Unfortunately, my patch was incomplete. I've compiled some other projects in the meantime and found that operator() in check_is_close and check_is_small needs to be "const" to get them working. This is due to the fact that Boost.Test now stores a "const&amp;" to those two object. I've attached a small patch fixing this new issue. Tested on gcc-4.2/4.3 and msvc-9.0 SP1. </p> Ticket Gennadiy Rozental Tue, 18 Oct 2011 09:45:04 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2390#comment:4 https://svn.boost.org/trac10/ticket/2390#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> I believe this is already fixed in trunk </p> Ticket