This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/49754] New: Let gcc warn about all uninitialized variables


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]