From 2ea43433e274ec284f7b7e556faa58a99497ca89 Mon Sep 17 00:00:00 2001 From: abolz Date: Fri, 15 Jun 2018 13:41:44 +0200 Subject: [PATCH] Fix bogus gcc warning --- include/rapidjson/reader.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/rapidjson/reader.h b/include/rapidjson/reader.h index 69baef5..4c99c93 100644 --- a/include/rapidjson/reader.h +++ b/include/rapidjson/reader.h @@ -1700,7 +1700,8 @@ private: else d = internal::StrtodNormalPrecision(d, p); - if (d == std::numeric_limits::infinity()) { + // Use > max, instead of == inf, to fix bogus warning -Wfloat-equal + if (d > std::numeric_limits::max()) { // Overflow // TODO: internal::StrtodX should report overflow (or underflow) RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset);