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

2014-07-09 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #33 from Jonathan Wakely --- Write a plugin. It's trivial using gcc-python-plugin, see http://blog.cuviper.com/2014/01/23/add-new-warnings-to-gcc-with-python/ A custom plugin is far more suitable to your purpose than adding yet anoth

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

2014-07-09 Thread unmobile at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 Phil Miller changed: What|Removed |Added CC||unmobile at gmail dot com --- Comment #32

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

2010-10-22 Thread ian at airs dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #31 from Ian Lance Taylor 2010-10-22 23:55:44 UTC --- As I understand this, this is a request for a warning for any definition of a global variable. Is that correct? Such a warning certainly can not be part of -Wall or -Wextra. Glo

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

2010-10-22 Thread ian at airs dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 Ian Lance Taylor changed: What|Removed |Added CC||ian at airs dot com --- Comment #30 fr

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

2010-10-22 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #29 from Jonathan Wakely 2010-10-22 20:36:45 UTC --- (In reply to comment #28) > > Are those libraries that crash designed to be used via dlopen, rather than > > linking to them explicitly? > Apparently they are (the authors would hav

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

2010-10-22 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #28 from Jeffrey Walton 2010-10-22 19:49:26 UTC --- (In reply to comment #26) > I don't think dlmopen has anything to do with C++ namespaces, but I could be > wrong > > Are those libraries that crash designed to be used via dlopen, r

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

2010-10-22 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #27 from Jeffrey Walton 2010-10-22 07:37:55 UTC --- (In reply to comment #26) > [SNIP] > Are those libraries that crash designed to be used via dlopen, rather than > linking to them explicitly? I'm not sure. How can one tell?

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

2010-10-22 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #26 from Jonathan Wakely 2010-10-22 07:34:55 UTC --- I don't think dlmopen has anything to do with C++ namespaces, but I could be wrong Are those libraries that crash designed to be used via dlopen, rather than linking to them explic

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

2010-10-21 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #25 from Jeffrey Walton 2010-10-22 05:52:07 UTC --- Created attachment 22112 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22112 Test for Load/Unload Crash Attached is a test program similar to the program posted on http://gcc.

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

2010-10-21 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #24 from Jeffrey Walton 2010-10-22 01:59:34 UTC --- Hi Jonathan, (In reply to comment #16) > (In reply to comment #13) > > > > [SNIP] > > There are a number of options for making sure the global is private to the > library, thus av

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

2010-10-21 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #23 from Jeffrey Walton 2010-10-21 19:52:12 UTC --- Hi Jonathan, [Sorry about the top post]. I'm going to wrap up my request, and hope you and the GCC team will find that -Wglobal-variable would be useful under some circumstances.

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

2010-10-21 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #22 from Andrew Pinski 2010-10-21 18:54:26 UTC --- (In reply to comment #20) > I'd forgotten the search was even there - I might suggest removing it, since > it's apparently not indexed anything this month, and probably much longer T

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

2010-10-21 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #21 from Jeffrey Walton 2010-10-21 18:49:49 UTC --- (In reply to comment #19) > Oh, I never use the search, it's always been useless > > just click on the first month in the list, > http://gcc.gnu.org/ml/gcc-help/2010-10/ shows the m

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

2010-10-21 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #20 from Jonathan Wakely 2010-10-21 18:47:03 UTC --- I'd forgotten the search was even there - I might suggest removing it, since it's apparently not indexed anything this month, and probably much longer

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

2010-10-21 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #19 from Jonathan Wakely 2010-10-21 18:41:20 UTC --- Oh, I never use the search, it's always been useless just click on the first month in the list, http://gcc.gnu.org/ml/gcc-help/2010-10/ shows the messages in date order, they appea

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

2010-10-21 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #18 from Jeffrey Walton 2010-10-21 17:37:15 UTC --- (In reply to comment #13) > 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

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

2010-10-21 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #17 from Jeffrey Walton 2010-10-21 16:59:55 UTC --- (In reply to comment #16) > (In reply to comment #13) > > > > Good point: here's what I would recommend: common sense. Myself, Alexey, a > > number of packagers across the globe, an

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

2010-10-21 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #16 from Jonathan Wakely 2010-10-21 16:24:18 UTC --- (In reply to comment #13) > > Good point: here's what I would recommend: common sense. Myself, Alexey, a > number of packagers across the globe, and untold others have performed th

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

2010-10-21 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #15 from Jeffrey Walton 2010-10-21 16:15:38 UTC --- (In reply to comment #11) > also, I'm not "the GCC team" and I don't speak for anyone else My apologies. I made the leap that you were part of the team due to your email address.

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

2010-10-21 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #14 from Jeffrey Walton 2010-10-21 16:13:36 UTC --- (In reply to comment #7) > (In reply to comment #6) > > Hi Johnathon, > > (In reply to comment #5) > > > oh, and I only see one process invovled there ... I'm still confused > > > a

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

2010-10-21 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #13 from Jeffrey Walton 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 time

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

2010-10-21 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #12 from Jonathan Wakely 2010-10-21 15:28:05 UTC --- I'm not on gcc-help, but I assume Alexey's looking at this report now ... > I would expect that TWO different instances of the global variable would > be created in TWO different s

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

2010-10-21 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #11 from Jonathan Wakely 2010-10-21 15:22:03 UTC --- also, I'm not "the GCC team" and I don't speak for anyone else

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

2010-10-21 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #10 from Jonathan Wakely 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 no

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

2010-10-21 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #9 from Jeffrey Walton 2010-10-21 15:04:44 UTC --- (In reply to comment #4) > I had a look at Cryptopp-SO-Test-1.zip > > building on 32-bit I can reproduce a segfault > > it doesn't build on 64-bit at all: > > 1) you can insert a p

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

2010-10-20 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #8 from Jeffrey Walton 2010-10-21 02:00:51 UTC --- (In reply to comment #4) > I had a look at Cryptopp-SO-Test-1.zip > > > > I can see some value in the warning you want, but it's not going to help if > you > don't use the compile

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

2010-10-20 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #7 from Jonathan Wakely 2010-10-20 23:48:33 UTC --- (In reply to comment #6) > Hi Johnathon, > (In reply to comment #5) > > oh, and I only see one process invovled there ... I'm still confused about > > the > > claim that more than o

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

2010-10-20 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #6 from Jeffrey Walton 2010-10-20 23:18:48 UTC --- Hi Johnathon, (In reply to comment #5) > oh, and I only see one process invovled there ... I'm still confused about the > claim that more than one process is involved... My bad - the

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

2010-10-20 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #5 from Jonathan Wakely 2010-10-20 22:47:59 UTC --- oh, and I only see one process invovled there ... I'm still confused about the claim that more than one process is involved - do you mean more than one thread?!

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

2010-10-20 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #4 from Jonathan Wakely 2010-10-20 22:46:45 UTC --- I had a look at Cryptopp-SO-Test-1.zip building on 32-bit I can reproduce a segfault it doesn't build on 64-bit at all: 1) you can insert a pointer into an ostream without casting

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

2010-10-20 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #3 from Jeffrey Walton 2010-10-20 17:38:59 UTC --- (In reply to comment #2) > (In reply to comment #1) > > (In reply to comment #0) > > > When a module meets the above compile and runtime requirements, a crash > > > can > > > occur i

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

2010-10-20 Thread noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #2 from Jeffrey Walton 2010-10-20 17:33:43 UTC --- (In reply to comment #1) > (In reply to comment #0) > > When a module meets the above compile and runtime requirements, a crash can > > occur in global objects with destructors when m

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

2010-10-20 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #1 from Jonathan Wakely 2010-10-20 15:52:53 UTC --- (In reply to comment #0) > When a module meets the above compile and runtime requirements, a crash can > occur in global objects with destructors when more than one process loads and