stlOutOfBounds error message created
This commit is contained in:
parent
9dff3f4c52
commit
5721e4469b
|
@ -608,7 +608,7 @@ void CheckBufferOverrunClass::STLSizeProblems()
|
||||||
|
|
||||||
if (Token::Match(tok, pattern.c_str()))
|
if (Token::Match(tok, pattern.c_str()))
|
||||||
{
|
{
|
||||||
_errorLogger->outOfBounds(_tokenizer, tok, "When " + num->str() + " == size(), " + pattern);
|
_errorLogger->stlOutOfBounds(_tokenizer, tok, "When " + num->str() + " == size(), " + pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
|
|
|
@ -95,6 +95,15 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void stlOutOfBounds(const Tokenizer *tokenizer, const Token *Location, const std::string &what)
|
||||||
|
{
|
||||||
|
_writemsg(tokenizer, Location, "error", "" + what + " is out of bounds", "stlOutOfBounds");
|
||||||
|
}
|
||||||
|
static bool stlOutOfBounds()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void noConstructor(const Tokenizer *tokenizer, const Token *Location, const std::string &classname)
|
void noConstructor(const Tokenizer *tokenizer, const Token *Location, const std::string &classname)
|
||||||
{
|
{
|
||||||
_writemsg(tokenizer, Location, "style", "The class '" + classname + "' has no constructor", "noConstructor");
|
_writemsg(tokenizer, Location, "style", "The class '" + classname + "' has no constructor", "noConstructor");
|
||||||
|
|
|
@ -61,6 +61,7 @@ int main()
|
||||||
err.push_back(Message("arrayIndexOutOfBounds", Message::all, "Array index out of bounds"));
|
err.push_back(Message("arrayIndexOutOfBounds", Message::all, "Array index out of bounds"));
|
||||||
err.push_back(Message("bufferOverrun", Message::all, "Buffer overrun"));
|
err.push_back(Message("bufferOverrun", Message::all, "Buffer overrun"));
|
||||||
err.push_back(Message("outOfBounds", Message::error, "%1 is out of bounds", "what"));
|
err.push_back(Message("outOfBounds", Message::error, "%1 is out of bounds", "what"));
|
||||||
|
err.push_back(Message("stlOutOfBounds", Message::error, "%1 is out of bounds", "what"));
|
||||||
|
|
||||||
// checkclass.cpp..
|
// checkclass.cpp..
|
||||||
err.push_back(Message("noConstructor", Message::style, "The class '%1' has no constructor", "classname"));
|
err.push_back(Message("noConstructor", Message::style, "The class '%1' has no constructor", "classname"));
|
||||||
|
|
Loading…
Reference in New Issue