-Wall not detecting uninitialized variables

Andrew Haley aph@redhat.com
Wed Sep 7 16:37:00 GMT 2011


On 09/07/2011 05:34 PM, sudhakar govindavajhala wrote:
> #include <stdio.h>
> 
> int main() {
>         int i;
>         printf(" hi sud %d \n", i);
>         return 0;
> 
> }

zebedee:~ $ gcc --version
gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4)

zebedee:~ $ gcc -Wall t.c
t.c: In function 'main':
t.c:5:15: warning: 'i' is used uninitialized in this function



More information about the Gcc-help mailing list