This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/49754] New: Let gcc warn about all uninitialized variables
- From: "giecrilj at stegny dot 2a.pl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 15 Jul 2011 06:16:32 +0000
- Subject: [Bug c/49754] New: Let gcc warn about all uninitialized variables
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49754
Summary: Let gcc warn about all uninitialized variables
Product: gcc
Version: 4.5.1
URL: https://bugzilla.novell.com/show_bug.cgi?id=705160#c1
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: giecrilj@stegny.2a.pl
The compiler gcc currently warns about uninitialized scalar variables but not
about compound variables.
== Steps to Reproduce ==
1.
{ cat>foo.c<<'/* EOF */' && gcc -Wall -pedantic-errors foo.c; }
struct i { int x; };
struct i foo () { struct i x; return x; }
int bar () { int y; return +y; }
/* EOF */
== Actual Results ==
foo.c: In function âbarâ:
foo.c:3:21: warning: âyâ is used uninitialized in this function
== Expected Results ==
foo.c: In function âfooâ:
foo.c:2:?: warning: âxâ is used uninitialized in this function
foo.c: In function âbarâ:
foo.c:3:21: warning: âyâ is used uninitialized in this function