diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index c2cec0940..3a6c3b1f7 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -279,6 +279,11 @@ static void print_stacktrace(FILE* output, bool demangling, int maxdepth, bool l } } #undef ADDRESSDISPLAYLENGTH +#else + UNUSED(output); + UNUSED(demangling); + UNUSED(maxdepth); + UNUSED(lowMem); #endif } @@ -341,7 +346,10 @@ static void CppcheckSignalHandler(int signo, siginfo_t * info, void * context) if (uc) { type = (int)uc->uc_mcontext.gregs[REG_ERR] & 2; } +#else + UNUSED(context); #endif + const Signalmap_t::const_iterator it=listofsignals.find(signo); const char * const signame = (it==listofsignals.end()) ? "unknown" : it->second.c_str(); bool printCallstack=true; // try to print a callstack? diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 59401ab55..0d05d9876 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -388,7 +388,7 @@ static bool checkMinSizes(const std::vector &m parameters.push_back(nullptr); } const MathLib::biguint len = CheckBufferOverrun::countSprintfLength(formatstr, parameters); - if (len > arraySize + 2U) + if (len > arraySize + 2) error = true; } else { const Token *strtoken = argtok->getValueTokenMaxStrLength(); diff --git a/lib/utils.h b/lib/utils.h index b5c46854e..d7b421eaa 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -78,4 +78,6 @@ inline static const char *getOrdinalText(int i) return "th"; } +#define UNUSED(x) (void)(x) + #endif