From 2cd9c4d8352873796108c191bd2d088f3624c5d8 Mon Sep 17 00:00:00 2001 From: Pavel P Date: Tue, 29 Oct 2024 00:46:58 +0500 Subject: [PATCH] Fix icx warning: explicit comparison with infinity in fast floating point mode with intel compiler (#1218) fixes #1217 --- include/boost/math/ccmath/isinf.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/boost/math/ccmath/isinf.hpp b/include/boost/math/ccmath/isinf.hpp index f1e00e34f5..ecf0d620ab 100644 --- a/include/boost/math/ccmath/isinf.hpp +++ b/include/boost/math/ccmath/isinf.hpp @@ -22,7 +22,14 @@ constexpr bool isinf BOOST_MATH_PREVENT_MACRO_SUBSTITUTION(T x) noexcept { if constexpr (std::numeric_limits::is_signed) { +#if defined(__clang_major__) && __clang_major__ >= 6 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-constant-compare" +#endif return x == std::numeric_limits::infinity() || -x == std::numeric_limits::infinity(); +#if defined(__clang_major__) && __clang_major__ >= 6 +#pragma clang diagnostic pop +#endif } else { @@ -32,7 +39,7 @@ constexpr bool isinf BOOST_MATH_PREVENT_MACRO_SUBSTITUTION(T x) noexcept else { using boost::math::isinf; - + if constexpr (!std::is_integral_v) { return (isinf)(x);