From 289e1813d87a5127956a44958c220c21ec5c2411 Mon Sep 17 00:00:00 2001 From: Pavel P Date: Thu, 28 Nov 2024 15:38:40 +0200 Subject: [PATCH] Fix clang warning when compiling with -ffast-math: use of infinity is undefined behavior due to the currently enabled floating-point options Fixes the following warning: ``` C:\boost_1_86_0\boost/math/ccmath/isinf.hpp(29,69): warning : use of infinity is undefined behavior due to the currently enabled floating-point options [-Wnan-infinity-disabled] C:\boost_1_86_0\boost/math/ccmath/isinf.hpp(29,25): warning : use of infinity is undefined behavior due to the currently enabled floating-point options [-Wnan-infinity-disabled] C:\boost_1_86_0\boost/math/ccmath/ldexp.hpp(50,38): note: in instantiation of function template specialization 'boost::math::ccmath::isinf' requested here C:\boost_1_86_0\boost/math/ccmath/ldexp.hpp(69,33): note: in instantiation of function template specialization 'boost::math::ccmath::ldexp' requested here ``` --- include/boost/math/ccmath/isinf.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/math/ccmath/isinf.hpp b/include/boost/math/ccmath/isinf.hpp index ecf0d620ab..f5f3f71a2b 100644 --- a/include/boost/math/ccmath/isinf.hpp +++ b/include/boost/math/ccmath/isinf.hpp @@ -25,6 +25,7 @@ constexpr bool isinf BOOST_MATH_PREVENT_MACRO_SUBSTITUTION(T x) noexcept #if defined(__clang_major__) && __clang_major__ >= 6 #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wtautological-constant-compare" +#pragma clang diagnostic ignored "-Wnan-infinity-disabled" #endif return x == std::numeric_limits::infinity() || -x == std::numeric_limits::infinity(); #if defined(__clang_major__) && __clang_major__ >= 6