From 3ef6b29f4a26f681e135def49c52691d49b797ed Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 29 Nov 2021 18:15:56 +0000 Subject: [PATCH] Avoid unsigned unary minux warning on MSVC in IntFromChars --- src/string_func_extra.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/string_func_extra.h b/src/string_func_extra.h index 1dc21dd9bb..c6df7ab588 100644 --- a/src/string_func_extra.h +++ b/src/string_func_extra.h @@ -72,7 +72,11 @@ inline bool IntFromChars(const char* first, const char* last, T& value) } } if (start == first) return false; - value = negative ? -out : out; + if (std::is_signed::value) { + value = negative ? -out : out; + } else { + value = out; + } return true; }