This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34772] -Winit-self ignored when compiling C++ (and ObjC++)
- From: "olly at survex dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jan 2008 00:58:34 -0000
- Subject: [Bug c++/34772] -Winit-self ignored when compiling C++ (and ObjC++)
- References: <bug-34772-2228@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from olly at survex dot com 2008-01-14 00:58 -------
If by "delete this option from the C++ FE" you mean that `g++ -Winit-self
[...]' would give an error, I'm not sure that's the best approach if the option
is likely to be sorted out for C++ in the future. Removing it now will break
existing makefiles which use -Winit-self for C++ compilations. And once
-Winit-self is sorted out for C++, it will be harder to write a makefile which
gives a warning for self-initialised variables for any GCC version (if it's
left as-is for now, then -Winit-self can just be specified all the time for any
GCC version >= 3.4).
The situation here is slightly odd in that -Winit-self is effectively always on
for C++, so in a way it does work - it's not specifying it (or -Wno-init-self)
which doesn't!
I think it would be better to fix the documentation to reflect the current
behaviour for C++/ObjC++, and mark this bug as an enhancement request.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772