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 #13 from Jeffrey Walton <noloader at gmail dot com> 2010-10-21 16:10:41 UTC ---
Hi Jonathon,

(In reply to comment #10)
> you realise you can wait and it will show up?
> http://gcc.gnu.org/ml/gcc-help/2010-10/msg00248.html
I've been known to be impatient at times :/

> That, like your case, is an ODR violation, and like your example static.cpp was
> not compiled with -fPIC
Ah! I was not aware I was violating anything :/ And the packagers were probably
not aware they were violating anything (but I can't speak for them).

> In response to your reply to him, I really don't think a warning about global
> variables is suitable for -Wall!
Agreed.

> 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

Good point: here's what I would recommend: common sense. Myself, Alexey, a
number of packagers across the globe, and untold others have performed this ODR
violation. Since you know more about the subject matter than me (I would like
to think of you as a SME - subject matter expert), what would you recommend so
that folks like myself, Alexey, distribution packagers, and others don't go
shooting ourselves in the foot?


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