[Bug c++/23628] Typeinfo comparison code easily breaks shared libs

geoffk at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Sep 18 21:02:00 GMT 2006



------- Comment #28 from geoffk at gcc dot gnu dot org  2006-09-18 21:02 -------
The current version of the documentation says, for -fvisibility=,

Be aware that headers from outside your project, in particular system
headers and headers from any other library you use, may not be
expecting to be compiled with visibility other than the default.  You
may need to explicitly say @samp{#pragma GCC visibility push(default)}
before including any such headers.
...
Note that @samp{-fvisibility} does affect C++ vague linkage
entities. This means that, for instance, an exception class that will
be thrown between DSOs must be explicitly marked with default
visibility so that the @samp{type_info} nodes will be unified between
the DSOs.

Also, the documentation for the 'hidden' attribute no longer uses ELF-specific
terminology, so anyone who understands the C++ standard should be able to
understand 'hidden' too.

Does that address this bug?

I don't think we can change the meaning of -fvisibility= at this point, people
are depending on the existing behaviour.  Apple has a -fvisibility-ms-compat
flag which aims to give Visual C++ bug-compatible linkage behaviour, that might
provide a good model for any additional features in this area.


-- 

geoffk at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |WORKSFORME


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



More information about the Gcc-bugs mailing list