Skip to content

Commit ddf0b7d

Browse files
authored
Fix warning C4365 emitted from printf.h (#3865)
1 parent 0166f45 commit ddf0b7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/fmt/printf.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace detail {
6060
// signed and unsigned integers.
6161
template <bool IsSigned> struct int_checker {
6262
template <typename T> static auto fits_in_int(T value) -> bool {
63-
unsigned max = max_value<int>();
63+
unsigned max = to_unsigned(max_value<int>());
6464
return value <= max;
6565
}
6666
static auto fits_in_int(bool) -> bool { return true; }
@@ -205,7 +205,7 @@ class printf_width_handler {
205205
specs_.align = align::left;
206206
width = 0 - width;
207207
}
208-
unsigned int_max = max_value<int>();
208+
unsigned int_max = to_unsigned(max_value<int>());
209209
if (width > int_max) report_error("number is too big");
210210
return static_cast<unsigned>(width);
211211
}

0 commit comments

Comments
 (0)