Add constParameter and constParameterCallback in --errorlist output
This commit is contained in:
parent
d5759d4708
commit
d5ef25e477
|
@ -1593,8 +1593,15 @@ void CheckOther::checkConstPointer()
|
|||
}
|
||||
void CheckOther::constVariableError(const Variable *var, const Function *function)
|
||||
{
|
||||
const std::string vartype((var && var->isArgument()) ? "Parameter" : "Variable");
|
||||
const std::string varname(var ? var->name() : std::string("x"));
|
||||
if (!var) {
|
||||
reportError(nullptr, Severity::style, "constParameter", "Parameter 'x' can be declared with const");
|
||||
reportError(nullptr, Severity::style, "constVariable", "Variable 'x' can be declared with const");
|
||||
reportError(nullptr, Severity::style, "constParameterCallback", "Parameter 'x' can be declared with const, however it seems that 'f' is a callback function.");
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string vartype(var->isArgument() ? "Parameter" : "Variable");
|
||||
const std::string varname(var->name());
|
||||
|
||||
ErrorPath errorPath;
|
||||
std::string id = "const" + vartype;
|
||||
|
|
Loading…
Reference in New Issue