Skip to content

Commit

Permalink
Fix clang warning when compiling with -ffast-math: use of infinity is…
Browse files Browse the repository at this point in the history
… 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<float>' 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<float, true>' requested here
```
  • Loading branch information
pps83 committed Nov 28, 2024
1 parent 8f843fd commit 289e181
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/boost/math/ccmath/isinf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>::infinity() || -x == std::numeric_limits<T>::infinity();
#if defined(__clang_major__) && __clang_major__ >= 6
Expand Down

0 comments on commit 289e181

Please sign in to comment.