clang does not warn for Uninitialized Array's

Hello

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 ?

Hello

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.

I’m sure it’s just a limitation of our current analysis that could be fixed. It’s worth a bug, yes.

John.