This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Fix PR 5582 and 10538, missed uninitialized variable warning
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>,Jason Merrill <jason at redhat dot com>,gcc-patches at gcc dot gnu dot org
- Date: Sun, 17 Aug 2003 14:55:54 -0400
- Subject: Re: [Patch] Fix PR 5582 and 10538, missed uninitialized variable warning
On Sunday, Aug 17, 2003, at 09:41 US/Eastern, Gabriel Dos Reis wrote:
Jason Merrill <jason@redhat.com> writes:
| > I also do not warn about int *x = &x; because x is initialized.
That code is invalid anyway.
I had meant void* p = &p;.
|
| Right.
Does it warn on
void* p = &p;
No it does not warn.
or
circular_buffer buf = circular_buffer(buf);
No warning for this either.
But a warning for:
struct circular_buffer { circular_buffer(const circular_buffer*); };
circular_buffer *foo()
{ circular_buffer *buf = new circular_buffer(buf); return buf; }
Which looks correctly warned for.
And a warning for this one too:
int f()
{
int &i = i;
return i;
}