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

[Bug c++/46097] Switch to warn of global variables in a C++ shared object


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


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