![]() |
![]() |
3344 | ![]() |
||||
![]() | |||||||
| Control flow | |||||||
Controlling expressions appear in if, for, while or do ... while constructs and as the first operand of a conditional operator. They are expressions which always undergo an implicit test against the value '0'. However they are most readable when formed from an operator which explicitly yields a result of 0 or 1. Message 3344 is generated when a controlling expression is not formed from one of the following operators:
/*PRQA S 2017,2213,3198,3199,3203,3408,3447 ++*/
extern int a;
extern int b;
extern void foo(void)
{
int r;
if (a) { } /* Message 3344 */
while (a + b) { --a; } /* Message 3344 */
r = a ? a : b; /* Message 3344 */
if (a != 0) { } /* OK */
while (a > b) { ++b; } /* OK */
r = (a < b) ? a : b; /* OK */
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |