TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - C Coding Standard
Search

Guideline:  7.15#2Checked automatically with code checker

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 ) )