![]() |
![]() |
0769 | ![]() |
||||
![]() | |||||||
| Control flow | |||||||
A break statement has been used to terminate an iteration statement, i.e. a while, do ... while or for statement. If multiple break statements are used within the same iteration statement, the code can become dangerously unstructured. For example:
/*PRQA S 2017,3408,3447 ++*/
extern int x;
extern int y;
extern int z;
extern void foo(int n)
{
while (n > 0)
{
--n;
if (n == x)
{
break; /* Message 0769 */
}
if (n == y)
{
break; /* Message 0771 */
}
if (n == z)
{
break; /* Message 0771 */
}
}
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |