diff --git a/CMake/CatchMiscFunctions.cmake b/CMake/CatchMiscFunctions.cmake index 44c87500..502994e3 100644 --- a/CMake/CatchMiscFunctions.cmake +++ b/CMake/CatchMiscFunctions.cmake @@ -53,6 +53,7 @@ function(add_warnings_to_targets targets) "-Wdangling" "-Wdeprecated" "-Wdeprecated-register" + "-Wdouble-promotion" "-Wexceptions" "-Wexit-time-destructors" "-Wextra" diff --git a/src/catch2/catch_approx.cpp b/src/catch2/catch_approx.cpp index 407586d1..7da83645 100644 --- a/src/catch2/catch_approx.cpp +++ b/src/catch2/catch_approx.cpp @@ -25,7 +25,7 @@ bool marginComparison(double lhs, double rhs, double margin) { namespace Catch { Approx::Approx ( double value ) - : m_epsilon( std::numeric_limits::epsilon()*100. ), + : m_epsilon( std::numeric_limits::epsilon()*100.f ), m_margin( 0.0 ), m_scale( 0.0 ), m_value( value ) diff --git a/tests/SelfTest/UsageTests/Condition.tests.cpp b/tests/SelfTest/UsageTests/Condition.tests.cpp index 211dd3b9..21c04a1a 100644 --- a/tests/SelfTest/UsageTests/Condition.tests.cpp +++ b/tests/SelfTest/UsageTests/Condition.tests.cpp @@ -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" ); @@ -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" );