MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / getEnclosingFunction

Function getEnclosingFunction

lib/checkother.cpp:1867–1876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1865}
1866
1867static const Function* getEnclosingFunction(const Variable* var)
1868{
1869 if (var->isArgument())
1870 return var->scope()->function;
1871 const Scope* scope = var->scope();
1872 while (scope && scope->type != ScopeType::eFunction) {
1873 scope = scope->nestedIn;
1874 }
1875 return scope ? scope->function : nullptr;
1876}
1877
1878void CheckOtherImpl::checkConstPointer()
1879{

Callers 1

checkConstPointerMethod · 0.85

Calls 1

scopeMethod · 0.80

Tested by

no test coverage detected