This is the mail archive of the
mailing list for the GCC project.
Re: Missing warning about uninitialized variable.
- From: John Love-Jensen <eljay at adobe dot com>
- To: "J.C. Pizarro" <jcpiza at gmail dot com>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Thu, 29 Nov 2007 15:30:05 -0600
- Subject: Re: Missing warning about uninitialized variable.
In your ishootyou.c, if your objective is to have the compiler display the
gcc -O -Wuninitialized -lm -Wall ishootyou.c -o ishootyou
ishootyou.c:12: warning: 'uninitialized_var_gurka' may be used uninitialized
in this function
...how come you are not enabling the warning, as I've done above?
Or even more so, as indicated by the comment in the code, treating it as an
gcc -Werror -O -Wuninitialized -lm -Wall ishootyou.c -o ishootyou
On my version of GCC, I realize that -Wall enables -Wuninitialized ... but
ONLY if optimizations are enabled. Which has already been mentioned by
someone else in this discussion thread.