Skip to content

Commit

Permalink
Fix bogus gcc warning
Browse files Browse the repository at this point in the history
  • Loading branch information
abolz committed Jun 15, 2018
1 parent a78c8e3 commit 2ea4343
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/rapidjson/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,8 @@ class GenericReader {
else
d = internal::StrtodNormalPrecision(d, p);

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

0 comments on commit 2ea4343

Please sign in to comment.