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

Method alwaysTrueStringVariableCompareError

lib/checkstring.cpp:148–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void CheckStringImpl::alwaysTrueStringVariableCompareError(const Token *tok, const std::string& str1, const std::string& str2)
149{
150 reportError(tok, Severity::warning, "stringCompare",
151 "Comparison of identical string variables.\n"
152 "The compared strings, '" + str1 + "' and '" + str2 + "', are identical. "
153 "This could be a logic bug.", CWE571, Certainty::normal);
154}
155
156
157//-----------------------------------------------------------------------------

Callers 1

getErrorMessagesMethod · 0.80

Calls 1

reportErrorFunction · 0.70

Tested by

no test coverage detected