[cfe-dev] clang does not warn for Uninitialized Array's

Mahesh Attarde via cfe-dev cfe-dev at lists.llvm.org
Sun Nov 5 22:42:50 PST 2017

I tried to run simple check with following example

int foo(){
int f[10];
return f[0];

with clang 5.0.0 -Wuninitialized There is no error.

with gcc 7.2.0 -Wuinitialized we get error.

<source>: In function 'int foo()':
5 : <source>:5:16: warning: 'f[0]' is used uninitialized in this
function [-Wuninitialized]
     return  f[0];
Compiler exited with result code 0

Wonder why?
Should i raise request on bugzilla ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20171106/912728f7/attachment.html>

More information about the cfe-dev mailing list