mismatching allocation size: moved to error suite
This commit is contained in:
parent
d8e8e2c7ee
commit
1637e867de
|
@ -190,11 +190,11 @@ public:
|
|||
|
||||
static void mismatchSize(ErrorLogger *logger, const Tokenizer *tokenizer, const Token *Location, const std::string &sz)
|
||||
{
|
||||
_writemsg(logger, tokenizer, Location, "all", "The given size " + sz + " is mismatching", "mismatchSize");
|
||||
_writemsg(logger, tokenizer, Location, "error", "The given size " + sz + " is mismatching", "mismatchSize");
|
||||
}
|
||||
static bool mismatchSize(const Settings &s)
|
||||
static bool mismatchSize()
|
||||
{
|
||||
return s._showAll;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void cstyleCast(ErrorLogger *logger, const Tokenizer *tokenizer, const Token *Location)
|
||||
|
|
|
@ -1823,7 +1823,7 @@ private:
|
|||
" int *p = malloc(3);\n"
|
||||
" free(p);\n"
|
||||
"}\n", false);
|
||||
ASSERT_EQUALS(std::string("[test.cpp:3]: (all) The given size 3 is mismatching\n"), errout.str());
|
||||
ASSERT_EQUALS(std::string("[test.cpp:3]: (error) The given size 3 is mismatching\n"), errout.str());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ int main()
|
|||
err.push_back(Message("resourceLeak", Message::error, "Resource leak: %1", "varname"));
|
||||
err.push_back(Message("deallocDealloc", Message::error, "Deallocating a deallocated pointer: %1", "varname"));
|
||||
err.push_back(Message("deallocuse", Message::error, "Using '%1' after it is deallocated / released", "varname"));
|
||||
err.push_back(Message("mismatchSize", Message::all, "The given size %1 is mismatching", "sz"));
|
||||
err.push_back(Message("mismatchSize", Message::error, "The given size %1 is mismatching", "sz"));
|
||||
|
||||
// checkother.cpp..
|
||||
err.push_back(Message("cstyleCast", Message::style, "C-style pointer casting"));
|
||||
|
|
Loading…
Reference in New Issue