[Bug tree-optimization/15880] New: No 'may be used uninitialize' warning for arrays.
bangerth at dealii dot org
gcc-bugzilla@gcc.gnu.org
Tue Jun 8 19:33:00 GMT 2004
While we get a 'may be used uninitialized' warning for this case:
-------------
struct X { int a; };
int f() {
X x;
return x.a;
}
-------------
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc -O2 -Wuninitialized
x.cc: In function `int f()':
x.cc:5: warning: 'x$a' is used uninitialized in this function
we do not for this case:
---------------
int f() {
int x[3];
return x[0];
}
---------------
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc -O2 -Wuninitialized
Does this have a reason or is it a bug? I tend to think it is the latter.
W.
--
Summary: No 'may be used uninitialize' warning for arrays.
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bangerth at dealii dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15880
More information about the Gcc-bugs
mailing list