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/51740] New: warning "is used uninitialized in this function" is missing if the variable initialized later


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51740

             Bug #: 51740
           Summary: warning "is used uninitialized in this function" is
                    missing if the variable initialized later
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: szo@szo.hu


Created attachment 26231
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26231
Code that should warn

gcc fails to emit the "is used uninitialized in this function" warning, if the
offending variable is initialized via a function later on.

See attachment. If compiled with 
gcc  -Wall  bug.c
gcc issues no warning. If line 13 is commented out, the correct
bug.c:11:9: warning: âoffenderâ is used uninitialized in this function
[-Wuninitialized]
is emitted.
I think it's not the same as #18501, because replacing line 13 with
offencer = 0;
still produces the warning correctly.


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