From 3c3c11a6cb565458d540292bd68d79a5f08a2041 Mon Sep 17 00:00:00 2001 From: Tony Asleson Date: Wed, 12 Feb 2020 13:27:06 -0600 Subject: [PATCH] Specify signed char x86 architecture default to signed characters. Other architectures default to unsigned characters. When building on non-x86 arch we get the following error ./json.hpp:22700:42: required from here ./json.hpp:8494:24: error: comparison is always true due to limited range of data type [-Werror=type-limits] 8494 | if ('\x00' <= c and c <= '\x1F') | ~~~~~~~^~~~ Signed-off-by: Tony Asleson --- include/nlohmann/detail/input/lexer.hpp | 2 +- single_include/nlohmann/json.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nlohmann/detail/input/lexer.hpp b/include/nlohmann/detail/input/lexer.hpp index 1b49d69b07..ab84828acf 100644 --- a/include/nlohmann/detail/input/lexer.hpp +++ b/include/nlohmann/detail/input/lexer.hpp @@ -1492,7 +1492,7 @@ class lexer position_t position {}; /// raw input token string (for error messages) - std::vector token_string {}; + std::vector token_string {}; /// buffer for variable-length tokens (numbers, strings) string_t token_buffer {}; diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 77bd1739c8..e050e9c9e4 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -8622,7 +8622,7 @@ class lexer position_t position {}; /// raw input token string (for error messages) - std::vector token_string {}; + std::vector token_string {}; /// buffer for variable-length tokens (numbers, strings) string_t token_buffer {};