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);