refactoring: Use style severity instead of possible error for the 'The size argument is given as a char constant'

This commit is contained in:
Daniel Marjamäki 2010-05-02 09:16:45 +02:00
parent 136b84eaf5
commit 883d462553
2 changed files with 3 additions and 4 deletions

View File

@ -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");
}

View File

@ -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"