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

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 20 22:46:00 GMT 2010


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 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 to int (and if you
insist on casting, do it to a type that has the same size as a pointer!)

2) that makefile doesn't compile dsotest-1.o and dsotest-2.o with -fPIC

To get it build I had to edit the code and the makefile, and after doing so it
doesn't crash. And with the same changes, it doesn't crash on 32-bit either.

So are you sure this isn't just user error?

I can see some value in the warning you want, but it's not going to help if you
don't use the compiler correctly (maybe I'm being unfair and you're using it
correctly for 32-bit, but my first instinct is that if it fails to build for a
different target then *something* is wrong!)



More information about the Gcc-bugs mailing list