![]() |
![]() |
2882 | ![]() |
||||
![]() | |||||||
| Control flow | |||||||
A local object with automatic storage duration is being defined with an initializer before the first case label in a switch statement. Storage space for the object will be reserved but the initialization will not be performed. The value of this object will be indeterminate and if it is used, the result will be undefined. For example:
/*PRQA S 0689,2017,2120,3120,3201,3220,3227,3234,3321,3408,3447 ++*/
extern void func(int p);
extern void foo(int n)
{
switch (n) /* 2882 */
{
int x = 3;
case 1:
func(x + 1); /* 2961 */
break;
case 2:
func(x + n);
break;
default:
x = 5;
func(x + n);
break;
}
}
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |