From 7c60db1e24f7dc2ee983b0f1844896af2ed6f445 Mon Sep 17 00:00:00 2001 From: vitaut Date: Fri, 4 Dec 2015 14:12:42 -0800 Subject: [PATCH] Fix a warning --- format.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/format.h b/format.h index b45656bc..a0101be1 100644 --- a/format.h +++ b/format.h @@ -3383,7 +3383,9 @@ int parse_nonnegative_int(const Char *&s) { } value = new_value; } while ('0' <= *s && *s <= '9'); - if (value > (std::numeric_limits::max)()) + // Convert to unsigned to prevent a warning. + unsigned max_int = (std::numeric_limits::max)(); + if (value > max_int) FMT_THROW(FormatError("number is too big")); return value; }