don't print warning message if --enable=warning is not specified.

message was of type:
(warning) Possible null pointer dereference: previous - otherwise it is redundant to check it against null.
This commit is contained in:
Matthias Krüger 2015-04-06 15:05:34 +02:00
parent 22d97fdbd6
commit 7fdbb91694
1 changed files with 4 additions and 0 deletions

View File

@ -242,6 +242,10 @@ bool CheckNullPointer::isPointerDeRef(const Token *tok, bool &unknown)
void CheckNullPointer::nullPointerLinkedList()
{
if (!_settings->isEnabled("warning"))
return;
const SymbolDatabase* const symbolDatabase = _tokenizer->getSymbolDatabase();
// looping through items in a linked list in a inner loop.