CheckSizeof: only report warnings when --enable=warning has been used

This commit is contained in:
Daniel Marjamäki 2015-01-06 15:20:42 +01:00
parent 1068e095e7
commit 88e7b55a2d
1 changed files with 2 additions and 0 deletions

View File

@ -63,6 +63,8 @@ void CheckSizeof::sizeofForNumericParameterError(const Token *tok)
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void CheckSizeof::checkSizeofForArrayParameter() void CheckSizeof::checkSizeofForArrayParameter()
{ {
if (!_settings->isEnabled("warning"))
return;
const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase(); const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase();
const std::size_t functions = symbolDatabase->functionScopes.size(); const std::size_t functions = symbolDatabase->functionScopes.size();
for (std::size_t i = 0; i < functions; ++i) { for (std::size_t i = 0; i < functions; ++i) {