From 45032f7d3b0201bf6de849599fb1eba98995c38b Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Fri, 11 Aug 2017 18:44:14 +0300 Subject: [PATCH] Use std mechanism to detect signedness --- lib/platform.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/platform.cpp b/lib/platform.cpp index 14af7bd6b..3a617ce57 100644 --- a/lib/platform.cpp +++ b/lib/platform.cpp @@ -22,6 +22,7 @@ #include #include +#include cppcheck::Platform::Platform() { @@ -56,8 +57,7 @@ bool cppcheck::Platform::platform(cppcheck::Platform::PlatformType type) if (type == Unspecified) { defaultSign = '\0'; } else { - char x = -1; - defaultSign = (x < 0) ? 's' : 'u'; + defaultSign = (std::numeric_limits::is_signed) ? 's' : 'u'; } char_bit = 8; short_bit = char_bit * sizeof_short;