This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13959] un-init local variable detection enhancement request
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Feb 2004 19:49:07 -0000
- Subject: [Bug c++/13959] un-init local variable detection enhancement request
- References: <20040201141801.13959.d.binderman@virgin.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-02-01 19:49 -------
The reason for might is because there are time where might is true (for an example:
int t( int j)
{
int i;
if(j)
i = 1;
g();
if(j)
return i;
return 1;
}
GCC will warn about i might be uesed uninit, there is already a different bug about that, suspened
never the less which means it most likely not going to be fixed).
As I should have said (but did not because it has been said many times and in other bugs):
Turning on this warning at -O0 increases compile time because you need to know flow
information.
There are large of cases in other software too (I do not persionally care about Redhat Fedora Core).
Compiling with optimization is the only way to get these warnings. If you want to correct all
warnings then do this: -O2 -W -Wall -Werror and then start fixing them until the program can
compile. This is still a dup of 11182 no matter which way you look at it.
*** This bug has been marked as a duplicate of 11182 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13959