| 241 | } |
| 242 | |
| 243 | void CheckConditionImpl::assignIfError(const Token *tok1, const Token *tok2, const std::string &condition, bool result) |
| 244 | { |
| 245 | if (tok2 && diag(tok2->tokAt(2))) |
| 246 | return; |
| 247 | std::list<const Token *> locations = { tok1, tok2 }; |
| 248 | reportError(locations, |
| 249 | Severity::style, |
| 250 | "assignIfError", |
| 251 | "Mismatching assignment and comparison, comparison '" + condition + "' is always " + std::string(bool_to_string(result)) + ".", CWE398, Certainty::normal); |
| 252 | } |
| 253 | |
| 254 | |
| 255 | void CheckConditionImpl::mismatchingBitAndError(const Token *tok1, const MathLib::bigint num1, const Token *tok2, const MathLib::bigint num2) |
no test coverage detected