This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23628] Typeinfo comparison code easily breaks shared libs
- From: "ghost at cs dot msu dot su" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Aug 2005 13:10:21 -0000
- Subject: [Bug c++/23628] Typeinfo comparison code easily breaks shared libs
- References: <20050829194742.23628.mmarcus@emarcus.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From ghost at cs dot msu dot su 2005-08-30 13:10 -------
To clarify what Marcus said, I've made a small example:
http://zigzag.cs.msu.su/~ghost/rtti-4.0
The third party library 'libhelper.so' is built with default visibility. I
want my own library 'libhelper2.so' to be built with hidden visibility.
However, my library contains this:
try
{
foo();
}
catch(my_exception& e)
{
Both 'foo' and 'my_exception' are defined in libhelper.so -- third party
library. So, if I build my library with hidden visibility, 'catch' no longer
works.
I have two solutions:
1. Add push/pops in other library headers, which is very inconvenient.
2. Create wrapper headers and add push/pops there, which is very inconvenient.
And if I forget just a single header (which was probably added in the last
version of third party library), I'll get hard to diagnose bug. Usability cost
is indeed high.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23628