refactoring: Use style severity instead of possible error for the 'The size argument is given as a char constant'
This commit is contained in:
parent
136b84eaf5
commit
883d462553
|
@ -149,10 +149,9 @@ void CheckBufferOverrun::outOfBounds(const Token *tok, const std::string &what)
|
|||
|
||||
void CheckBufferOverrun::sizeArgumentAsChar(const Token *tok)
|
||||
{
|
||||
if (_settings && _settings->inconclusive == false)
|
||||
if (_settings && !_settings->_checkCodingStyle)
|
||||
return;
|
||||
|
||||
reportError(tok, Severity::possibleError, "sizeArgumentAsChar", "The size argument is given as a char constant");
|
||||
reportError(tok, Severity::style, "sizeArgumentAsChar", "The size argument is given as a char constant");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1830,7 +1830,7 @@ private:
|
|||
" char s[10];\n"
|
||||
" memset(s, 5, '*');\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:4]: (possible error) The size argument is given as a char constant\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (style) The size argument is given as a char constant\n", errout.str());
|
||||
|
||||
check("void foo()\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue