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

Method isuninitargbad

lib/library.cpp:1251–1264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1249}
1250
1251bool Library::isuninitargbad(const Token *ftok, int argnr, int indirect, bool *hasIndirect) const
1252{
1253 const ArgumentChecks *arg = getarg(ftok, argnr);
1254 if (!arg) {
1255 // non-scan format string argument should not be uninitialized
1256 const std::string funcname = getFunctionName(ftok);
1257 const auto it = utils::as_const(mData->mFunctions).find(funcname);
1258 if (it != mData->mFunctions.cend() && it->second.formatstr && !it->second.formatstr_scan)
1259 return true;
1260 }
1261 if (hasIndirect && arg && arg->notuninit >= 1)
1262 *hasIndirect = true;
1263 return arg && arg->notuninit >= indirect;
1264}
1265
1266
1267/** get allocation info for function */

Callers 3

isFunctionParUsageMethod · 0.80
getFunctionUsageFunction · 0.80
function_arg_variadicMethod · 0.80

Calls 1

findMethod · 0.45

Tested by 1

function_arg_variadicMethod · 0.64