From 0f669bed1a6d71cb220396dee6a66107948222b9 Mon Sep 17 00:00:00 2001 From: Pavel P Date: Fri, 25 Oct 2024 02:50:46 +0200 Subject: [PATCH] Fix icx warning: explicit comparison with infinity in fast floating point mode with intel compiler 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..f762cc45aa 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) { +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-constant-compare" +#endif return x == std::numeric_limits::infinity() || -x == std::numeric_limits::infinity(); +#ifdef __clang__ +#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);