[Bug c/49754] New: Let gcc warn about all uninitialized variables
giecrilj at stegny dot 2a.pl
gcc-bugzilla@gcc.gnu.org
Fri Jul 15 06:17:00 GMT 2011
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
More information about the Gcc-bugs
mailing list