File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -894,19 +894,8 @@ void CheckOther::checkVariableScope()
894894
895895 // In C it is common practice to declare local variables at the
896896 // start of functions.
897- if (mTokenizer ->isC ()) {
898- // Try to autodetect what coding style is used. If a local variable is
899- // declared in an inner scope then we will warn about all variables.
900- bool limitScope = false ;
901- for (const Variable* var : symbolDatabase->variableList ()) {
902- if (var && var->isLocal () && var->nameToken ()->scope ()->type != Scope::ScopeType::eFunction) {
903- limitScope = true ;
904- break ;
905- }
906- }
907- if (!limitScope)
908- return ;
909- }
897+ if (mSettings ->daca && mTokenizer ->isC ())
898+ return ;
910899
911900 for (const Variable* var : symbolDatabase->variableList ()) {
912901 if (!var || !var->isLocal () || (!var->isPointer () && !var->isReference () && !var->typeStartToken ()->isStandardType ()))
You can’t perform that action at this time.
0 commit comments