From e0f92d675ee9a5b88278f8c334d924385219aa9b Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 19 Aug 2014 07:14:25 -0700 Subject: [PATCH] Fix a warning. --- test/printf-test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/printf-test.cc b/test/printf-test.cc index b89ce17e..4f9167a4 100644 --- a/test/printf-test.cc +++ b/test/printf-test.cc @@ -338,7 +338,8 @@ void TestLength(const char *length_spec) { std::numeric_limits::min()) { TestLength(length_spec, fmt::LongLong(min) - 1); } - if (max < std::numeric_limits::max()) + fmt::ULongLong long_long_max = std::numeric_limits::max(); + if (max < 0 || static_cast(max) < long_long_max) TestLength(length_spec, fmt::LongLong(max) + 1); TestLength(length_spec, std::numeric_limits::min()); TestLength(length_spec, std::numeric_limits::max());