Inspectopedia
 
2024.3

Incompatible bitwise mask operation

Warning
Last modified: 03 December 2024

Reports bitwise mask expressions which are guaranteed to evaluate to true or false.

The inspection checks the expressions of the form (var & constant1) == constant2 or (var | constant1) == constant2, where constant1 and constant2 are incompatible bitmask constants.

Example: