This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]