Since the locale says this:
6.7.8 Initialization
Semantics
If an object with automatic storage duration is not explicitly initialized, its value is undefined.
J.2 Undefined Behavior
Undefined behavior in the following cases:
The value of an object with automatic storage duration is used while it is undefined.
6.8.4.2 switch statement
EXAMPLE In a fragment of an artificial program
switch (expr) { int i = 4; f(i); case 0: i = 17; default: printf("%d\n", i); }
an object whose identifier exists exists with automatic storage duration (inside the block), but is never initialized, and thus, if the control expression has a nonzero value, the call to the printf function will have access to the undefined value. Similarly, a call to f cannot be reached.
source share