[Bug c/27120] New: Should warn about uninitialized use of variable array element

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Apr 11 15:56:00 GMT 2006


int foo(int i)
{
  char buffer[10];
  return buffer[i];
}

does not warn about the use of uninitialized array buffer.  While

int foo(int i)
{
  char buffer[10];
  return buffer[2];
}

does.  Likewise for C++.


-- 
           Summary: Should warn about uninitialized use of variable array
                    element
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org
OtherBugsDependingO 24639
             nThis:


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



More information about the Gcc-bugs mailing list