Null pointers: Don't warn when first argument to freopen() is NULL
This commit is contained in:
parent
52df31b501
commit
20b84fcdee
|
@ -110,7 +110,6 @@ void CheckNullPointer::parseFunctionCall(const Token &tok, std::list<const Token
|
|||
functionNames1_all.insert("fgetwc");
|
||||
functionNames1_all.insert("fgetpos");
|
||||
functionNames1_all.insert("fsetpos");
|
||||
functionNames1_all.insert("freopen");
|
||||
functionNames1_all.insert("fscanf");
|
||||
functionNames1_all.insert("fprintf");
|
||||
functionNames1_all.insert("fwscanf");
|
||||
|
@ -161,6 +160,7 @@ void CheckNullPointer::parseFunctionCall(const Token &tok, std::list<const Token
|
|||
|
||||
functionNames1_uninit.insert("perror");
|
||||
functionNames1_uninit.insert("fflush");
|
||||
functionNames1_uninit.insert("freopen");
|
||||
}
|
||||
|
||||
// standard functions that dereference second parameter..
|
||||
|
|
|
@ -1719,6 +1719,9 @@ private:
|
|||
" typeof(*NULL) y;\n"
|
||||
"}", true);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void f() { freopen(NULL, m, stdin); }");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void gcc_statement_expression() {
|
||||
|
|
Loading…
Reference in New Issue