mirror of
				https://gitlab.alpinelinux.org/alpine/aports.git
				synced 2025-10-31 16:31:40 +01:00 
			
		
		
		
	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
		
			
				
	
	
		
			20 lines
		
	
	
		
			746 B
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			20 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{{}};
 |