Re: intializing the variables and compling with optimization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



J M Sharath Bharadwaj bharadwaj wrote:
hi All,

Is GCC going to perform a better optimization, if I am going to
initialize the variable explicitly. I am asking this because I was
reading the GCC online doc for warning options like as in
http://www.cs.cmu.edu/cgi-bin/info2www?(gcc.info)Warning%20Options

This is a strange question.

If you read an uninitialized variable your program contains undefined
behaviour, and optimization is going to be the least of your problems.
If you don't read from an uninitialized variable it doesn't matter.

Andrew.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux