cat > foo.c << EOF
int main() {
  int f[2];
  f[0] = 4;
  return f[1];
}
EOF
ln -s foo.c foo.cpp
gcc foo.c -Wall -O2
g++ foo.cpp -Wall -O2

In C, the warning is "foo.c:2: warning: 'f[1]' is used uninitialized in this
function"
In C++, the warning is "foo.cpp:2: warning: 'f$1' is used uninitialized in this
function"

Minor bug with perhaps a minor fix.

-- 
           Summary: c++ "is used uninitialized" warning on arrays hard to
                    read
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: benoit dot hudson at gmail dot com
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to