Actions

EmSys

CCoding Style - Parenthesize to resolve ambiguity2

From EdWiki

Parenthesize to resolve ambiguity ...

The bit wise operators & and ! have lower precedence than relational operations like ==, so despite its appearance,

if( x & MASK == BITS )

actually means

if( x & (MASK == BITS ) )

which is certainly not the programmer’s intent

if( (x & MASK) == BITS )