This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/46097] Switch to warn of global variables in a C++ shared object
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 Oct 2010 15:16:55 +0000
- Subject: [Bug c++/46097] Switch to warn of global variables in a C++ shared object
- Auto-submitted: auto-generated
- References: <bug-46097-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097
--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-21 15:16:48 UTC ---
you realise you can wait and it will show up?
http://gcc.gnu.org/ml/gcc-help/2010-10/msg00248.html
That, like your case, is an ODR violation, and like your example static.cpp was
not compiled with -fPIC
In response to your reply to him, I really don't think a warning about global
variables is suitable for -Wall!
could you be a bit less vague about what exactly you want the warning to do?
should it only warn about globally visible objects in shared libraries?
that wouldn't help that case, where the problematic global is in static.o,
which isn't compiled with -fPIC or -shared, so the warning would have to come
from the linker when static.o is linked to dynamic1.o or dynamic2.o