From a16ff5787b104945f735b1a2250b85c441a1af8e Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 19 Oct 2024 07:58:53 -0700 Subject: [PATCH] Add support for code units > 0xFFFF in fill --- include/fmt/format.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 622c2750..054641b6 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -677,7 +677,8 @@ FMT_CONSTEXPR void for_each_codepoint(string_view s, F f) { auto num_chars_left = to_unsigned(s.data() + s.size() - p); if (num_chars_left == 0) return; - FMT_ASSERT(num_chars_left < block_size, ""); + // Suppress bogus -Wstringop-overflow. + if (FMT_GCC_VERSION) num_chars_left &= 3; char buf[2 * block_size - 1] = {}; copy(p, p + num_chars_left, buf); const char* buf_ptr = buf;