Bug 15880 - No 'may be used uninitialize' warning for arrays.
Summary: No 'may be used uninitialize' warning for arrays.
Status: RESOLVED DUPLICATE of bug 10138
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2004-06-08 19:33 UTC by Wolfgang Bangerth
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bangerth 2004-06-08 19:33:06 UTC
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.
Comment 1 Andrew Pinski 2004-06-08 19:39:42 UTC
Yes this is because array are not Scalared replaced yet.
And this is a dup of bug 10138.

*** This bug has been marked as a duplicate of 10138 ***