Fixed another variable shadowing warning.

This commit is contained in:
PKEuS 2014-08-06 14:26:48 +02:00
parent b5cf56790c
commit 639f1fa85a
2 changed files with 3 additions and 3 deletions

View File

@ -86,7 +86,7 @@ void CheckVaarg::va_list_usage()
bool exitOnEndOfStatement = false;
const Token* tok = var->nameToken()->next();
for (const Token* tok = var->nameToken()->next(); tok != var->scope()->classEnd; tok = tok->next()) {
for (; tok != var->scope()->classEnd; tok = tok->next()) {
if (Token::Match(tok, "va_start ( %varid% ,", var->declarationId())) {
if (open)
va_start_subsequentCallsError(tok, var->name());

View File

@ -104,7 +104,7 @@ private:
" va_list arg_ptr;\n"
" va_start(arg_ptr, szBuffer);\n"
"}");
ASSERT_EQUALS("[test.cpp:2]: (error) va_list 'arg_ptr' was opened but not closed by va_end().\n", errout.str());
ASSERT_EQUALS("[test.cpp:4]: (error) va_list 'arg_ptr' was opened but not closed by va_end().\n", errout.str());
check("void Format(char* szFormat, char (*szBuffer)[_Size], ...) {\n"
" va_list arg_ptr;\n"
@ -112,7 +112,7 @@ private:
" if(sth) return;\n"
" va_end(arg_ptr);\n"
"}");
ASSERT_EQUALS("[test.cpp:2]: (error) va_list 'arg_ptr' was opened but not closed by va_end().\n", errout.str());
ASSERT_EQUALS("[test.cpp:4]: (error) va_list 'arg_ptr' was opened but not closed by va_end().\n", errout.str());
}
void va_list_usedBeforeStarted() {