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

Method mismatchingBitAndError

lib/checkcondition.cpp:255–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253
254
255void CheckConditionImpl::mismatchingBitAndError(const Token *tok1, const MathLib::bigint num1, const Token *tok2, const MathLib::bigint num2)
256{
257 std::list<const Token *> locations = { tok1, tok2 };
258
259 std::ostringstream msg;
260 msg << "Mismatching bitmasks. Result is always 0 ("
261 << "X = Y & 0x" << std::hex << num1 << "; Z = X & 0x" << std::hex << num2 << "; => Z=0).";
262
263 reportError(locations,
264 Severity::style,
265 "mismatchingBitAnd",
266 msg.str(), CWE398, Certainty::normal);
267}
268
269
270static void getnumchildren(const Token *tok, std::list<MathLib::bigint> &numchildren)

Callers 1

getErrorMessagesMethod · 0.80

Calls 2

reportErrorFunction · 0.70
strMethod · 0.45

Tested by

no test coverage detected