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

Function isCastToVoid

lib/checkother.cpp:1670–1683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1668}
1669
1670static bool isCastToVoid(const Variable* var)
1671{
1672 if (!var)
1673 return false;
1674 if (!var->scope())
1675 return false;
1676 for (const Token* tok = var->scope()->bodyStart; tok != var->scope()->bodyEnd; tok = tok->next()) {
1677 if (tok->varId() != var->declarationId())
1678 continue;
1679 if (isVoidCast(tok->astParent()))
1680 return true;
1681 }
1682 return false;
1683}
1684
1685void CheckOtherImpl::checkConstVariable()
1686{

Callers 1

checkConstVariableMethod · 0.85

Calls 4

isVoidCastFunction · 0.85
scopeMethod · 0.80
nextMethod · 0.80
astParentMethod · 0.80

Tested by

no test coverage detected