diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp index 03d6ba352..aeec34eeb 100644 --- a/include/nlohmann/detail/output/serializer.hpp +++ b/include/nlohmann/detail/output/serializer.hpp @@ -919,7 +919,7 @@ class serializer } }; - JSON_ASSERT(byte < utf8d.size()); + JSON_ASSERT(static_cast(byte) < utf8d.size()); const std::uint8_t type = utf8d[byte]; codep = (state != UTF8_ACCEPT) diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 57a90cbd4..cd4924d96 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -19755,7 +19755,7 @@ class serializer } }; - JSON_ASSERT(byte < utf8d.size()); + JSON_ASSERT(static_cast(byte) < utf8d.size()); const std::uint8_t type = utf8d[byte]; codep = (state != UTF8_ACCEPT)