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

Method compareValueOutOfTypeRangeError

lib/checkcondition.cpp:2087–2096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2085}
2086
2087void CheckConditionImpl::compareValueOutOfTypeRangeError(const Token *comparisonTok, const std::string &type, MathLib::bigint value, bool result)
2088{
2089 reportError(
2090 comparisonTok,
2091 Severity::style,
2092 "compareValueOutOfTypeRangeError",
2093 "Comparing expression of type '" + type + "' against value " + MathLib::toString(value) + ". Condition is always " + bool_to_string(result) + ".",
2094 CWE398,
2095 Certainty::normal);
2096}
2097
2098void CheckCondition::runChecks(const Tokenizer &tokenizer, ErrorLogger& errorLogger)
2099{

Callers 1

getErrorMessagesMethod · 0.80

Calls 3

bool_to_stringFunction · 0.85
reportErrorFunction · 0.70
toStringFunction · 0.70

Tested by

no test coverage detected