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

SR:  7.16#1Checked automatically with code checker

Synopsis:The second and third operands of the conditional operator shall not contain side-effects because they are conditionally executed.
Language:C
Severity Level:4
Category:EXPRESSIONS


Description:

It is clearer to use an if statement to make the conditional execution explicit.

Example:

(a > b) ? i++ : j++; /* WRONG, i,j not always changed */