2 ms·
goto jumpover; int i = 0; jumpover : printf("%i", i); /* i is defined but uninitialized. */
by quelsolaar 4y ago
goto jumpover;
int i = 0;
jumpover :
printf("%i", i); /* i is defined but uninitialized. */
- DougMerritt 4y agoYep, that seems to be simpler but equivalent. A comment there said they don't see the problem (presumably due to the all-too-common "screw the human, git gud" attitude in the face of Undefined Behavior). And I further presume that the most defensible answer is that the problem is that asking the compiler for a warning on uninitialized variable use fails in this case. As an aside on the presumed language/standards-lawyering, as a compiler writer, I personally think that compilers should try their best to help the user, far more than trying to take the side of the language standard in a user-hostile way, but that's just me.