Fixed another variable shadowing warning.
This commit is contained in:
parent
b5cf56790c
commit
639f1fa85a
|
@ -86,7 +86,7 @@ void CheckVaarg::va_list_usage()
|
||||||
bool exitOnEndOfStatement = false;
|
bool exitOnEndOfStatement = false;
|
||||||
|
|
||||||
const Token* tok = var->nameToken()->next();
|
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 (Token::Match(tok, "va_start ( %varid% ,", var->declarationId())) {
|
||||||
if (open)
|
if (open)
|
||||||
va_start_subsequentCallsError(tok, var->name());
|
va_start_subsequentCallsError(tok, var->name());
|
||||||
|
|
|
@ -104,7 +104,7 @@ private:
|
||||||
" va_list arg_ptr;\n"
|
" va_list arg_ptr;\n"
|
||||||
" va_start(arg_ptr, szBuffer);\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"
|
check("void Format(char* szFormat, char (*szBuffer)[_Size], ...) {\n"
|
||||||
" va_list arg_ptr;\n"
|
" va_list arg_ptr;\n"
|
||||||
|
@ -112,7 +112,7 @@ private:
|
||||||
" if(sth) return;\n"
|
" if(sth) return;\n"
|
||||||
" va_end(arg_ptr);\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() {
|
void va_list_usedBeforeStarted() {
|
||||||
|
|
Loading…
Reference in New Issue