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

Method badBitmaskCheckError

lib/checkcondition.cpp:351–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351void CheckConditionImpl::badBitmaskCheckError(const Token *tok, bool isNoOp)
352{
353 if (isNoOp)
354 reportError(tok, Severity::style, "badBitmaskCheck", "Operator '|' with one operand equal to zero is redundant.", CWE571, Certainty::normal);
355 else
356 reportError(tok, Severity::warning, "badBitmaskCheck", "Result of operator '|' is always true if one operand is non-zero. Did you intend to use '&'?", CWE571, Certainty::normal);
357}
358
359void CheckConditionImpl::comparison()
360{

Callers 1

getErrorMessagesMethod · 0.80

Calls 1

reportErrorFunction · 0.70

Tested by

no test coverage detected