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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user