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

Reply via email to