This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
comiler warnings
- From: Dima Sorkin <dsorkin at techunix dot technion dot ac dot il>
- To: gcc-help at gcc dot gnu dot org
- Date: Sun, 25 Dec 2005 15:40:59 +0200
- Subject: comiler warnings
Hi.
Look at the following peace of code:
for(unsigned i;i<10;++i){
do something with "i";
}
gcc-3.3.6 under slackware linux:
When compiling in debug mode (-g), no warnings.
When compiling with optimization (-O2), it warns
that "i" will be used unitialized in the loop.
Why does compiler behave this way ?
Thank you.
Dima.