This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: why Winit-self (was Re: proposal to clean up @node Warning Options in invoke.texi)
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- Cc: chris dot pickett at mail dot mcgill dot ca, gcc at gcc dot gnu dot org
- Date: 11 Jan 2007 04:13:07 +0100
- Subject: Re: why Winit-self (was Re: proposal to clean up @node Warning Options in invoke.texi)
- References: <6c33472e0701101742o1c31f83cjd1db56a0066e811a@mail.gmail.com>
"Manuel López-Ibáñez" <lopezibanez@gmail.com> writes:
| On 11 Jan 2007 02:08:48 +0100, Gabriel Dos Reis
| <gdr@integrable-solutions.net> wrote:
| > I'm well aware of the history of "-Winit-self". The issue is more
| > subtile that you would like to make it appear. You would have to study
| > more carefully the threads relating to this issue. If you dig the
| > archive, you should be able to find example of
| >
| > circular_buffer buf = buf;
| >
| > [ or void* p = &p; ]
|
| Sorry for being so slow but I don't get it. neither Winit-self nor
| Wuninitialized warn for void *p=&p; so how that example justifies the
| existence of Winit-self ?
Consider again
circular_buffer buf = buf;
That is an example of code that is not written to work around -Wunitialized.
In parenthesis, I offered "void* p = &p" as an ultimate reduction when
the body of the copy constructor of circual_buffer is known, but
apparently that had teh side effect of side track many :-(
-- Gaby