diff --git a/include/boost/int128/detail/int128_imp.hpp b/include/boost/int128/detail/int128_imp.hpp index 715b0023..a9bdd9ca 100644 --- a/include/boost/int128/detail/int128_imp.hpp +++ b/include/boost/int128/detail/int128_imp.hpp @@ -3264,7 +3264,7 @@ BOOST_INT128_HOST_DEVICE constexpr int128_t operator%(const int128_t lhs, const } #else - const auto is_neg{static_cast(lhs < 0)}; + const auto is_neg{lhs < 0}; int128_t remainder {}; diff --git a/include/boost/int128/detail/mini_from_chars.hpp b/include/boost/int128/detail/mini_from_chars.hpp index a3198144..a399e1d8 100644 --- a/include/boost/int128/detail/mini_from_chars.hpp +++ b/include/boost/int128/detail/mini_from_chars.hpp @@ -183,7 +183,7 @@ BOOST_INT128_HOST_DEVICE constexpr int from_chars_integer_impl(const char* first } // Return the parsed value, adding the sign back if applicable - // If we have overflowed then we do not return the result + // If we have overflowed, then we do not return the result if (overflowed) { return EDOM; @@ -201,7 +201,18 @@ BOOST_INT128_HOST_DEVICE constexpr int from_chars_integer_impl(const char* first // This value will be negative to differentiate from errno values // since they are in the range of acceptable distances + + // This cast is useless on 32-bit platforms + #if defined(__GNUC__) && !defined(__clang__) + # pragma GCC diagnostic push + # pragma GCC diagnostic ignored "-Wuseless-cast" + #endif + return static_cast(first - next); + + #if defined(__GNUC__) && !defined(__clang__) + # pragma GCC diagnostic pop + #endif } } // namespace impl