Skip to content

Commit d926a71

Browse files
committed
Fix sign conversion warning in benchmarks
1 parent 0bc2b6c commit d926a71

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/benchmark_uints.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ using namespace std::chrono_literals;
4040
# pragma GCC diagnostic push
4141
# pragma GCC diagnostic ignored "-Wfloat-equal"
4242
# pragma GCC diagnostic ignored "-Wold-style-cast"
43-
# pragma GCC diagnostic ignored "-Wstringop-overread"
4443
# define BOOST_DECIMAL_NO_INLINE __attribute__ ((__noinline__))
44+
# if __GNUC__ >= 11
45+
# pragma GCC diagnostic ignored "-Wstringop-overread"
46+
# endif
4547
#endif
4648

4749
// 0 = 1 word
@@ -245,7 +247,7 @@ BOOST_DECIMAL_NO_INLINE void test_digit_counting(const std::vector<T>& data_vec,
245247
for (std::size_t i {}; i < data_vec.size(); ++i)
246248
{
247249
const auto val1 = data_vec[i];
248-
s += boost::decimal::detail::num_digits(val1);
250+
s += static_cast<std::size_t>(boost::decimal::detail::num_digits(val1));
249251
}
250252
}
251253

0 commit comments

Comments
 (0)