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

Function isForwardJump

lib/checkfunctions.cpp:338–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338static bool isForwardJump(const Token *gotoToken)
339{
340 if (!Token::Match(gotoToken, "goto %name% ;"))
341 return false;
342 for (const Token *prev = gotoToken; gotoToken; gotoToken = gotoToken->previous()) {
343 if (Token::Match(prev, "%name% :") && prev->str() == gotoToken->strAt(1))
344 return true;
345 if (prev->str() == "{" && prev->scope()->type == ScopeType::eFunction)
346 return false;
347 }
348 return false;
349}
350
351static const Token *checkMissingReturnScope(const Token *tok, const Library &library)
352{

Callers 1

checkMissingReturnScopeFunction · 0.85

Calls 2

scopeMethod · 0.80
strMethod · 0.45

Tested by

no test coverage detected