Fix warnings

This commit is contained in:
Ayaz Salikhov 2017-05-25 01:19:27 +03:00
parent 1c2339ae1d
commit 4bbc830a85
3 changed files with 11 additions and 1 deletions

View File

@ -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?

View File

@ -388,7 +388,7 @@ static bool checkMinSizes(const std::vector<Library::ArgumentChecks::MinSize> &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();

View File

@ -78,4 +78,6 @@ inline static const char *getOrdinalText(int i)
return "th";
}
#define UNUSED(x) (void)(x)
#endif