1
0
mirror of https://github.com/nlohmann/json.git synced 2026-07-21 19:23:03 +04:00

🚨 guard GCC pragmas #2924

This commit is contained in:
Niels Lohmann
2021-08-11 23:55:46 +02:00
parent 57d31d1b83
commit e20f3f95eb
4 changed files with 24 additions and 0 deletions
@@ -1066,8 +1066,10 @@ char* to_chars(char* first, const char* last, FloatType value)
*first++ = '-';
}
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
if (value == 0) // +-0
{
*first++ = '0';
@@ -1076,7 +1078,9 @@ char* to_chars(char* first, const char* last, FloatType value)
*first++ = '0';
return first;
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
JSON_ASSERT(last - first >= std::numeric_limits<FloatType>::max_digits10);