Skip to content

Commit 2ea4343

Browse files
committed
Fix bogus gcc warning
1 parent a78c8e3 commit 2ea4343

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/rapidjson/reader.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,8 @@ class GenericReader {
17001700
else
17011701
d = internal::StrtodNormalPrecision(d, p);
17021702

1703-
if (d == std::numeric_limits<double>::infinity()) {
1703+
// Use > max, instead of == inf, to fix bogus warning -Wfloat-equal
1704+
if (d > std::numeric_limits<double>::max()) {
17041705
// Overflow
17051706
// TODO: internal::StrtodX should report overflow (or underflow)
17061707
RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset);

0 commit comments

Comments
 (0)