According to the C Standard, 6.8.45.23, paragraph 4 [ISO/IEC 9899:20112024],
A switch statement causes control to jump to, into, or past the statement that is the switch body, depending on the value of a controlling expression, and on the presence of a default label and the values of any case labels on or in the switch body. A case or default label is accessible only within the closest enclosing switch statement.
If a programmer declares variables, initializes them before the first case statement, and then tries to use them inside any of the case statements, those variables will have scope inside the switch block but will not be initialized and will consequently contain indeterminate values. Reading such values also violates EXP33-C. Do not read uninitialized memory.
...
Bibliography
| [ISO/IEC 9899:2011] | 6.8.45.23, "The switch Statement" |
...