From d059b51d5a92d663034f1fe8c767cdba98aa218d Mon Sep 17 00:00:00 2001 From: Edoardo Morandi Date: Wed, 14 May 2025 11:42:25 +0200 Subject: [PATCH] fix: avoid an implicit conversion using size_t The number of bits is used to express the size of a buffer. Using an `int` causes an implicit conversion warning, let's use a `size_t` which is the right type for the job. --- include/fmt/format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 2e779621..a8657e64 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2018,7 +2018,7 @@ FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, write_int_arg arg, const format_specs& specs) -> OutputIt { static_assert(std::is_same>::value, ""); - constexpr int buffer_size = num_bits(); + constexpr size_t buffer_size = num_bits(); char buffer[buffer_size]; if (is_constant_evaluated()) fill_n(buffer, buffer_size, '\0'); const char* begin = nullptr;