This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/38945] New: No warning when using unset variable
- From: "fredrik at hederstierna dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2009 14:36:14 -0000
- Subject: [Bug c/38945] New: No warning when using unset variable
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The 4.x compilers does not warn when using unset variables.
The 3.x compilers did warn on this:
Example:
int use_unset_variable(int y)
{
int x;
switch(y) {
case 0:
x = 0;
break;
default:
break;
}
x++;
return x;
}
Variable x could be unset when returning.
I use all warnings possible:
-Wall -W -Wextra
Best Regards
Fredrik
--
Summary: No warning when using unset variable
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fredrik at hederstierna dot com
GCC build triplet: arm-elf-gcc
GCC host triplet: x86-intel
GCC target triplet: arm-elf-gcc
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38945