-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Due to `-Werror`, this fails to build on gcc >= 10.0.1. This has been [reported][0] to json upstream, and fixed in this [pr][1]. Backport the fix to horizon [0]:nlohmann/json#1939 [1]:nlohmann/json#2144
- Loading branch information
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
testing/horizon/json-cast-character-to-unsigned-for-comparrison.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Description: GCC 10.0.1 started to warn on redundant comparisons. Horizon | ||
builds with -Werror, so this warning is turned into an error. Upstream fixed this, | ||
so backport to Horizon. | ||
|
||
Based on https://github.com/nlohmann/json/pull/2144/commits/23051df2c71dd3f9698e01de3cbfab0034c6e50e | ||
|
||
diff --git a/3rdparty/json.hpp b/3rdparty/json.hpp | ||
index 06da815..58e3f27 100644 | ||
--- a/3rdparty/json.hpp | ||
+++ b/3rdparty/json.hpp | ||
@@ -8491,7 +8491,7 @@ scan_number_done: | ||
std::string result; | ||
for (const auto c : token_string) | ||
{ | ||
- if ('\x00' <= c and c <= '\x1F') | ||
+ if (static_cast<unsigned char>(c) <= '\x1F') | ||
{ | ||
// escape control characters | ||
std::array<char, 9> cs{{}}; |