Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
353d5971
Commit
353d5971
authored
4 years ago
by
Sven Fink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more suppressions on float comparisons
parent
095aae19
develop
bon8
coverity_scan
gcc_warning_flags
icpc
issue2932
issue3232_use_catch
master
release/3.10.2
release/3.10.3
release/3.10.4
release/3.10.5
string_view
string_view2
update_doctest
v3.10.5
v3.10.4
v3.10.3
v3.10.2
v3.10.1
v3.10.0
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
include/nlohmann/detail/conversions/to_chars.hpp
include/nlohmann/detail/conversions/to_chars.hpp
+3
-0
include/nlohmann/json.hpp
include/nlohmann/json.hpp
+3
-0
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+6
-0
No files found.
include/nlohmann/detail/conversions/to_chars.hpp
View file @
353d5971
...
...
@@ -1066,6 +1066,8 @@ char* to_chars(char* first, const char* last, FloatType value)
*
first
++
=
'-'
;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
if
(
value
==
0
)
// +-0
{
*
first
++
=
'0'
;
...
...
@@ -1074,6 +1076,7 @@ char* to_chars(char* first, const char* last, FloatType value)
*
first
++
=
'0'
;
return
first
;
}
#pragma GCC diagnostic pop
JSON_ASSERT
(
last
-
first
>=
std
::
numeric_limits
<
FloatType
>::
max_digits10
);
...
...
This diff is collapsed.
Click to expand it.
include/nlohmann/json.hpp
View file @
353d5971
...
...
@@ -6278,6 +6278,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
*/
friend
bool
operator
==
(
const_reference
lhs
,
const_reference
rhs
)
noexcept
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
const
auto
lhs_type
=
lhs
.
type
();
const
auto
rhs_type
=
rhs
.
type
();
...
...
@@ -6342,6 +6344,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}
return
false
;
#pragma GCC diagnostic pop
}
/*!
...
...
This diff is collapsed.
Click to expand it.
single_include/nlohmann/json.hpp
View file @
353d5971
...
...
@@ -15984,6 +15984,8 @@ char* to_chars(char* first, const char* last, FloatType value)
*first++ = '-';
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
if (value == 0) // +-0
{
*first++ = '0';
...
...
@@ -15992,6 +15994,7 @@ char* to_chars(char* first, const char* last, FloatType value)
*first++ = '0';
return first;
}
#pragma GCC diagnostic pop
JSON_ASSERT(last - first >= std::numeric_limits<FloatType>::max_digits10);
...
...
@@ -23366,6 +23369,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
*/
friend bool operator==(const_reference lhs, const_reference rhs) noexcept
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
const auto lhs_type = lhs.type();
const auto rhs_type = rhs.type();
...
...
@@ -23430,6 +23435,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}
return false;
#pragma GCC diagnostic pop
}
/*!
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment