GCC Bugzilla – Bug 38945
No warning when using uninitialized variable
Last modified: 2009-01-26 19:27:15 UTC
The 4.x compilers does not warn when using unset variables.
The 3.x compilers did warn on this:
int use_unset_variable(int y)
x = 0;
Variable x could be unset when returning.
I use all warnings possible:
-Wall -W -Wextra
I am almost sure that this is CCP again assuming that the undefined value is the same as the constant assigned, hence x++ is converted to 0++. This can be checked using -fdump-tree-all-all-lineno.
If so, a duplicate of bug 18501.
Yes this is a dup of bug 18501.
*** This bug has been marked as a duplicate of 18501 ***