From ddf0b7d2b54750944c074de6478ccf83dabfdf48 Mon Sep 17 00:00:00 2001 From: Baardi Date: Sat, 24 Feb 2024 00:33:21 +0000 Subject: [PATCH] Fix warning C4365 emitted from printf.h (#3865) --- include/fmt/printf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/printf.h b/include/fmt/printf.h index 4f0fe9ae..c060952d 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -60,7 +60,7 @@ namespace detail { // signed and unsigned integers. template struct int_checker { template static auto fits_in_int(T value) -> bool { - unsigned max = max_value(); + unsigned max = to_unsigned(max_value()); return value <= max; } static auto fits_in_int(bool) -> bool { return true; } @@ -205,7 +205,7 @@ class printf_width_handler { specs_.align = align::left; width = 0 - width; } - unsigned int_max = max_value(); + unsigned int_max = to_unsigned(max_value()); if (width > int_max) report_error("number is too big"); return static_cast(width); }