This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Minimal GCC/Linux shared lib + EH bug example
- From: martin at v dot loewis dot de (Martin v. Loewis)
- To: "David Abrahams" <david dot abrahams at rcn dot com>
- Cc: "Jason Merrill" <jason at redhat dot com>, "Ralf W. Grosse-Kunstleve" <rwgk at cci dot lbl dot gov>, <gcc at gcc dot gnu dot org>
- Date: 12 May 2002 16:30:36 +0200
- Subject: Re: Minimal GCC/Linux shared lib + EH bug example
- References: <09b501c1f634$04747d80$6501a8c0@boostconsulting.com><wvl4rhdn0d9.fsf@prospero.cambridge.redhat.com><0c2501c1f9ab$32ea8a40$8f01a8c0@boostconsulting.com>
"David Abrahams" <david.abrahams@rcn.com> writes:
> However, for my application I'd be content if EH was just comparing the
> type_info::name() strings, as Martin von Loewis stated was the case in
> 2.95.x and again in 3.1:
I misinterpreted the code. It reads
#if !__GXX_MERGED_TYPEINFO_NAMES
// We can't rely on common symbols being shared between shared objects.
bool std::type_info::
operator== (const std::type_info& arg) const
{
return (&arg == this) || (__builtin_strcmp (name (), arg.name ()) == 0);
}
#endif
What I missed is that this implementation was conditional, with the
condition being
#if !__GXX_WEAK__
// If weak symbols are not supported, typeinfo names are not merged.
#define __GXX_MERGED_TYPEINFO_NAMES 0
#else
// On platforms that support weak symbols, typeinfo names are merged.
#define __GXX_MERGED_TYPEINFO_NAMES 1
#endif
So on platforms with weak symbol support, operator== is implemented as
bool operator==(const type_info& __arg) const
{ return __name == __arg.__name; }
instead; this includes Linux.
Regards,
Martin