Synopsis: | The operands of logical AND should 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 stablish the grouping of operands, especially in expressions that mix logical and itwise operations.
Example: if ( (a > b ) && (i != 0 ) ) |