[Bug c++/11182] gcc should warn when assigning unassigned variables
charles@kde.org
gcc-bugzilla@gcc.gnu.org
Sat Jun 14 17:24:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11182
------- Additional Comments From charles@kde.org 2003-06-14 17:24 -------
Subject: Re: gcc should warn when assigning unassigned variables
On Saturday 14 June 2003 10:14, you wrote:
> ------- Additional Comments From falk.hueffner@student.uni-tuebingen.de
> 2003-06-14 17:14 ------- Subject: Re: gcc should warn when assigning
> unassigned variables
>
> "pinskia@physics.uc.edu" <gcc-bugzilla@gcc.gnu.org> writes:
> > With this source: int f(){ int x; int y = x; return y; } I get a
> > warning at -O1 -W -Wall with 2.95.2, 3.1, and the mainline (). Do
> > you want the warning at -O0 if you do this is a know problem?
>
> I suppose it's rather another instance of
>
> int f() { int x = x; return x; }
>
> i. e., no warning when initializing a variable with itself, which is
> already c++/5284 and probably some more.
Well, more than "initializing a variable with itself", but "assigning a
variable with an uninitialized variable"
{
int x;
int y = x;
}
should warn it as well
More information about the Gcc-bugs
mailing list