This is the mail archive of the gcc-patches@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]

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;
}


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