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

Method redundantCopyError

lib/checkother.cpp:732–738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730}
731
732void CheckOtherImpl::redundantCopyError(const Token *tok1, const Token* tok2, const std::string& var)
733{
734 const std::list<const Token *> callstack = { tok1, tok2 };
735 reportError(callstack, Severity::performance, "redundantCopy",
736 "$symbol:" + var + "\n"
737 "Buffer '$symbol' is being written before its old content has been used.", CWE563, Certainty::normal);
738}
739
740void CheckOtherImpl::redundantAssignmentError(const Token *tok1, const Token* tok2, const std::string& var, bool inconclusive)
741{

Callers 1

getErrorMessagesMethod · 0.80

Calls 1

reportErrorFunction · 0.70

Tested by

no test coverage detected