This is the mail archive of the gcc@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: why Winit-self (was Re: proposal to clean up @node Warning Options in invoke.texi)


"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


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