From 3df1efa11a67d3a61fcae35e73d4e99b3fc43bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Sigurd=20M=C3=B8ller?= Date: Fri, 23 Feb 2024 22:50:58 +0100 Subject: [PATCH] Fix warning C4365 emitted from printf.h --- 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 4f0fe9aeca2c..c060952d9e8b 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); }