Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -Wdouble-promotion to common warnings #2707

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CMake/CatchMiscFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function(add_warnings_to_targets targets)
"-Wdangling"
"-Wdeprecated"
"-Wdeprecated-register"
"-Wdouble-promotion"
"-Wexceptions"
"-Wexit-time-destructors"
"-Wextra"
Expand Down
2 changes: 1 addition & 1 deletion src/catch2/catch_approx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ bool marginComparison(double lhs, double rhs, double margin) {
namespace Catch {

Approx::Approx ( double value )
: m_epsilon( std::numeric_limits<float>::epsilon()*100. ),
: m_epsilon( std::numeric_limits<float>::epsilon()*100.f ),
m_margin( 0.0 ),
m_scale( 0.0 ),
m_value( value )
Expand Down
4 changes: 2 additions & 2 deletions tests/SelfTest/UsageTests/Condition.tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ TEST_CASE( "Ordering comparison checks that should succeed" )

REQUIRE( data.float_nine_point_one > 9 );
REQUIRE( data.float_nine_point_one < 10 );
REQUIRE( data.float_nine_point_one < 9.2 );
REQUIRE( data.float_nine_point_one < 9.2f );

REQUIRE( data.str_hello <= "hello" );
REQUIRE( data.str_hello >= "hello" );
Expand All @@ -163,7 +163,7 @@ TEST_CASE( "Ordering comparison checks that should fail", "[.][failing]" )

CHECK( data.float_nine_point_one < 9 );
CHECK( data.float_nine_point_one > 10 );
CHECK( data.float_nine_point_one > 9.2 );
CHECK( data.float_nine_point_one > 9.2f );

CHECK( data.str_hello > "hello" );
CHECK( data.str_hello < "hello" );
Expand Down