Synopsis: | The operands of logical OR shall be parenthesised unless both are simple values, identifiers, or function calls. |
Language: | C |
Severity Level: | 7 |
Category: | EXPRESSIONS |
Description: |
The precedence of operators in C is not intuitive. Extra parentheses aid the reader establish the grouping of operands, especially in expressions that mix logical and bitwise operations.
Example: if ( (a > b ) || (i != 0 ) ) |