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 */ |