Skip to content

Commit fe6cdfe

Browse files
committed
Ignore GCC conversion warnings
1 parent 323171f commit fe6cdfe

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

include/boost/decimal/decimal128.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,18 @@ constexpr decimal128::decimal128(T1 coeff, T2 exp, bool sign) noexcept
745745
if (unsigned_coeff_digits > detail::precision_v<decimal128> + 1)
746746
{
747747
const auto digits_to_remove {unsigned_coeff_digits - (detail::precision_v<decimal128> + 1)};
748+
749+
#if defined(__GNUC__) && !defined(__clang__)
750+
# pragma GCC diagnostic push
751+
# pragma GCC diagnostic ignored "-Wconversion"
752+
#endif
753+
748754
unsigned_coeff /= detail::pow10(static_cast<Unsigned_Integer>(digits_to_remove));
755+
756+
#if defined(__GNUC__) && !defined(__clang__)
757+
# pragma GCC diagnostic pop
758+
#endif
759+
749760
exp += digits_to_remove;
750761
unsigned_coeff_digits -= digits_to_remove;
751762
}

include/boost/decimal/decimal32.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,18 @@ constexpr decimal32::decimal32(T coeff, T2 exp, bool sign) noexcept // NOLINT(re
625625
if (unsigned_coeff_digits > detail::precision + 1)
626626
{
627627
const auto digits_to_remove {unsigned_coeff_digits - (detail::precision + 1)};
628+
629+
#if defined(__GNUC__) && !defined(__clang__)
630+
# pragma GCC diagnostic push
631+
# pragma GCC diagnostic ignored "-Wconversion"
632+
#endif
633+
628634
unsigned_coeff /= detail::pow10(static_cast<Unsigned_Integer>(digits_to_remove));
635+
636+
#if defined(__GNUC__) && !defined(__clang__)
637+
# pragma GCC diagnostic pop
638+
#endif
639+
629640
exp += digits_to_remove;
630641
unsigned_coeff_digits -= digits_to_remove;
631642
}

include/boost/decimal/decimal64.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,18 @@ constexpr decimal64::decimal64(T1 coeff, T2 exp, bool sign) noexcept
632632
if (unsigned_coeff_digits > detail::precision_v<decimal64> + 1)
633633
{
634634
const auto digits_to_remove {unsigned_coeff_digits - (detail::precision_v<decimal64> + 1)};
635+
636+
#if defined(__GNUC__) && !defined(__clang__)
637+
# pragma GCC diagnostic push
638+
# pragma GCC diagnostic ignored "-Wconversion"
639+
#endif
640+
635641
unsigned_coeff /= detail::pow10(static_cast<Unsigned_Integer>(digits_to_remove));
642+
643+
#if defined(__GNUC__) && !defined(__clang__)
644+
# pragma GCC diagnostic pop
645+
#endif
646+
636647
exp += digits_to_remove;
637648
unsigned_coeff_digits -= digits_to_remove;
638649
}

0 commit comments

Comments
 (0)