From 572ddf43b5452a30ee49f0a38b2eb2d03beb4997 Mon Sep 17 00:00:00 2001 From: Dair Grant Date: Sun, 1 Mar 2020 00:44:38 +0000 Subject: [PATCH] Fix -Wsign-conversion in bigint::subtract_aligned. n is assigned a size_t, and only used for comparisons with j. j is assigned 0, compared to n (size_t), and passed to basic_memory_buffer::operator[] (size_t). --- include/fmt/format-inl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 1ac206a8..5fc8d2da 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -526,7 +526,7 @@ class bigint { FMT_ASSERT(compare(*this, other) >= 0, ""); bigit borrow = 0; int i = other.exp_ - exp_; - for (int j = 0, n = static_cast(other.bigits_.size()); j != n; + for (size_t j = 0, n = other.bigits_.size(); j != n; ++i, ++j) { subtract_bigits(i, other.bigits_[j], borrow); }