Skip to content

Commit

Permalink
Fix warning C4365 emitted from printf.h (fmtlib#3865)
Browse files Browse the repository at this point in the history
  • Loading branch information
Baardi authored and happymonkey1 committed Apr 6, 2024
1 parent ada3369 commit f3e1304
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/fmt/printf.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace detail {
// signed and unsigned integers.
template <bool IsSigned> struct int_checker {
template <typename T> static auto fits_in_int(T value) -> bool {
unsigned max = max_value<int>();
unsigned max = to_unsigned(max_value<int>());
return value <= max;
}
static auto fits_in_int(bool) -> bool { return true; }
Expand Down Expand Up @@ -205,7 +205,7 @@ class printf_width_handler {
specs_.align = align::left;
width = 0 - width;
}
unsigned int_max = max_value<int>();
unsigned int_max = to_unsigned(max_value<int>());
if (width > int_max) report_error("number is too big");
return static_cast<unsigned>(width);
}
Expand Down

0 comments on commit f3e1304

Please sign in to comment.