stlOutOfBounds error message created

This commit is contained in:
Reijo Tomperi 2009-02-10 19:36:49 +00:00
parent 9dff3f4c52
commit 5721e4469b
3 changed files with 11 additions and 1 deletions

View File

@ -608,7 +608,7 @@ void CheckBufferOverrunClass::STLSizeProblems()
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();

View File

@ -95,6 +95,15 @@ public:
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)
{
_writemsg(tokenizer, Location, "style", "The class '" + classname + "' has no constructor", "noConstructor");

View File

@ -61,6 +61,7 @@ int main()
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("outOfBounds", Message::error, "%1 is out of bounds", "what"));
err.push_back(Message("stlOutOfBounds", Message::error, "%1 is out of bounds", "what"));
// checkclass.cpp..
err.push_back(Message("noConstructor", Message::style, "The class '%1' has no constructor", "classname"));