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

Method configurationInfo

lib/checkleakautovar.cpp:138–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void CheckLeakAutoVarImpl::configurationInfo(const Token* tok, const std::pair<const Token*, VarInfo::Usage>& functionUsage)
139{
140 if (mSettings.checkLibrary && functionUsage.second == VarInfo::USED &&
141 (!functionUsage.first || !functionUsage.first->function() || !functionUsage.first->function()->hasBody())) {
142 std::string funcStr = functionUsage.first ? mSettings.library.getFunctionName(functionUsage.first) : "f";
143 if (funcStr.empty())
144 funcStr = "unknown::" + functionUsage.first->str();
145 reportError(tok,
146 Severity::information,
147 "checkLibraryUseIgnore",
148 "--check-library: Function " + funcStr + "() should have <use>/<leak-ignore> configuration");
149 }
150}
151
152void CheckLeakAutoVarImpl::doubleFreeError(const Token *tok, const Token *prevFreeTok, const std::string &varname, int type)
153{

Callers 1

getErrorMessagesMethod · 0.80

Calls 5

getFunctionNameMethod · 0.80
reportErrorFunction · 0.70
functionMethod · 0.45
emptyMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected