...
In the example mentioned below, the variable i will be instantiated with automatic storage duration within the block, but it’s never initialized. Thus, if the controlling expression has a non-zero value, the cause to printf will access an indeterminate value of i. Similarly, the call to function will also never get executed.
| Warning |
|---|
|
| Wiki Markup |
|---|
int func ( int expr )
{
switch (expr) {
int i = 4;
f(i);
case 0:
i = 17;
/*falls through into default code */
default:
printf(“%d\nâ€, i);
}
return 0;
}
|
|