Opened 14 years ago

Closed 11 years ago

#2390 closed Patches (fixed)

[patch] fix gcc-4.3 "unused" warning in floating_point_comparison

Reported by: Bryan Silverthorn <bcs26@…> Owned by: Gennadiy Rozental
Milestone: To Be Determined Component: test
Version: Boost Development Trunk Severity: Problem
Keywords: test floating point gcc 4.3 warnings Cc:

Description

Using -Wall -Werror under gcc-4.3, compilation of floating_point_comparison can fail with a "defined but not used" warning.

The attached patch against r49167 fixes this warning.

Attachments (3)

float_comparison_unused.patch (1.8 KB ) - added by Bryan Silverthorn <bcs26@…> 14 years ago.
patch against r49167
floating_point_comparison.hpp.diff (1.6 KB ) - added by Jürgen Hunold 14 years ago.
Improved patch for all gcc-4.3 warnings
floating_point_comparison.hpp.2.diff (1.2 KB ) - added by Jürgen Hunold 14 years ago.
Patch to add missing const qualifiers

Download all attachments as: .zip

Change History (7)

by Bryan Silverthorn <bcs26@…>, 14 years ago

patch against r49167

by Jürgen Hunold, 14 years ago

Improved patch for all gcc-4.3 warnings

comment:1 by Jürgen Hunold, 14 years ago

Keywords: test floating point gcc 4.3 warnings added

I constructed an improved patch based on the ideas of Steven Watanabe for check_is_close and check_is_small.

And added a patch from John Maddock to add explicit parenthesis around potentially ambigous && and

The mailing list thread starts with: http://lists.boost.org/Archives/boost/2008/10/143756.php I've tested the patch with gcc-4.3.2 on SuSE-Linux 11 and msvc-9.0.

comment:2 by Gennadiy Rozental, 14 years ago

Resolution: fixed
Status: newclosed

by Jürgen Hunold, 14 years ago

Patch to add missing const qualifiers

comment:3 by Jürgen Hunold, 14 years ago

Resolution: fixed
Status: closedreopened

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&" 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.

comment:4 by Gennadiy Rozental, 11 years ago

Resolution: fixed
Status: reopenedclosed

I believe this is already fixed in trunk

Note: See TracTickets for help on using tickets.