uninitialized variables: return|goto are not used in variable declarations
This commit is contained in:
parent
7dbf22aa3f
commit
6ac2b6ab14
|
@ -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("*"));
|
||||
|
||||
|
|
Loading…
Reference in New Issue