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

Method stlOutOfBoundsError

lib/checkstl.cpp:1353–1359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1351}
1352
1353void CheckStlImpl::stlOutOfBoundsError(const Token *tok, const std::string &num, const std::string &var, bool at)
1354{
1355 if (at)
1356 reportError(tok, Severity::error, "stlOutOfBounds", "$symbol:" + var + "\nWhen " + num + "==$symbol.size(), $symbol.at(" + num + ") is out of bounds.", CWE788, Certainty::normal);
1357 else
1358 reportError(tok, Severity::error, "stlOutOfBounds", "$symbol:" + var + "\nWhen " + num + "==$symbol.size(), $symbol[" + num + "] is out of bounds.", CWE788, Certainty::normal);
1359}
1360
1361void CheckStlImpl::negativeIndex()
1362{

Callers 1

getErrorMessagesMethod · 0.80

Calls 1

reportErrorFunction · 0.70

Tested by

no test coverage detected