The bitwise operators &, | can be mistaken for the boolean operators && and ||.
This rule raises an issue when & or | is used in a boolean context.
if (a & b) { ... } // Noncompliant; & used in error
if (a && b) { ... }
When a file contains other bitwise operations, (^, <<, >>>, >>,
~, &=, ^=, |=, <<=, >>=, >>>= and
& or | used with a numeric literal as the right operand) all issues in the file are ignored, because it is evidence that
bitwise operations are truly intended in the file.