Write two FIXME comments, create library configuration to replace hardcoded checks

This commit is contained in:
Daniel Marjamäki 2017-04-23 15:34:45 +02:00
parent 198c8878ee
commit 3f069d9e44
1 changed files with 15 additions and 0 deletions

View File

@ -292,6 +292,13 @@ void CheckFunctions::mathfunctionCallWarning(const Token *tok, const std::string
//---------------------------------------------------------------------------
void CheckFunctions::memsetZeroBytes()
{
// FIXME:
// Replace this with library configuration.
// For instance:
// <arg nr="3">
// <warn knownIntValue="0" severity="warning" msg="..."/>
// </arg>
if (!_settings->isEnabled(Settings::WARNING))
return;
@ -320,6 +327,14 @@ void CheckFunctions::memsetZeroBytesError(const Token *tok)
void CheckFunctions::memsetInvalid2ndParam()
{
// FIXME:
// Replace this with library configuration.
// For instance:
// <arg nr="2">
// <not-float/>
// <warn possibleIntValue=":-129,256:" severity="warning" msg="..."/>
// </arg>
const bool printPortability = _settings->isEnabled(Settings::PORTABILITY);
const bool printWarning = _settings->isEnabled(Settings::WARNING);
if (!printWarning && !printPortability)