1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-26 04:35:39 +03:00
aports/testing/horizon/json-cast-character-to-unsigned-for-comparrison.patch
Kevin Daudt c2868dae68 testing/horizon: fix ftbfs
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]:https://github.com/nlohmann/json/issues/1939
[1]:https://github.com/nlohmann/json/pull/2144
2021-01-18 11:29:49 +00:00

19 lines
746 B
Diff

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{{}};