uninitialized variables: return|goto are not used in variable declarations

This commit is contained in:
Daniel Marjamäki 2009-10-30 15:23:27 +01:00
parent 7dbf22aa3f
commit 6ac2b6ab14
1 changed files with 3 additions and 0 deletions

View File

@ -1331,6 +1331,9 @@ void CheckOther::uninitvar()
}
if (Token::Match(tok, "[{};] %type% *| %var% ;"))
{
if (Token::Match(tok->next(), "return|goto"))
continue;
// if it's a pointer, dereferencing is forbidden
const bool pointer(tok->strAt(2) == std::string("*"));