Clarify 'invalidFunctionArg' messages
This commit is contained in:
parent
f7cda81c0c
commit
d3d3d31613
|
@ -133,12 +133,20 @@ void CheckFunctions::invalidFunctionArgError(const Token *tok, const std::string
|
||||||
errmsg << " The value is " << invalidValue->intvalue << " but the valid values are '" << validstr << "'.";
|
errmsg << " The value is " << invalidValue->intvalue << " but the valid values are '" << validstr << "'.";
|
||||||
else
|
else
|
||||||
errmsg << " The value is 0 or 1 (boolean) but the valid values are '" << validstr << "'.";
|
errmsg << " The value is 0 or 1 (boolean) but the valid values are '" << validstr << "'.";
|
||||||
reportError(tok,
|
if (invalidValue)
|
||||||
(!invalidValue || !invalidValue->condition) ? Severity::error : Severity::warning,
|
reportError(getErrorPath(tok, invalidValue, "Invalid argument"),
|
||||||
"invalidFunctionArg",
|
invalidValue->errorSeverity() ? Severity::error : Severity::warning,
|
||||||
errmsg.str(),
|
"invalidFunctionArg",
|
||||||
CWE628,
|
errmsg.str(),
|
||||||
invalidValue && invalidValue->inconclusive);
|
CWE628,
|
||||||
|
invalidValue->inconclusive);
|
||||||
|
else
|
||||||
|
reportError(tok,
|
||||||
|
Severity::error,
|
||||||
|
"invalidFunctionArg",
|
||||||
|
errmsg.str(),
|
||||||
|
CWE628,
|
||||||
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckFunctions::invalidFunctionArgBoolError(const Token *tok, const std::string &functionName, int argnr)
|
void CheckFunctions::invalidFunctionArgBoolError(const Token *tok, const std::string &functionName, int argnr)
|
||||||
|
|
Loading…
Reference in New Issue