-fno-rtti and exception handling

Mike Stump mrs@windriver.com
Thu Mar 16 13:56:00 GMT 2000


> Date: Thu, 16 Mar 2000 20:39:32 +0100
> From: "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de>
> To: mrs@windriver.com

> Can you please elaborate somewhat? I guess it is not possible to mix
> objects that where compiled with -fno-rtti, and some that are, then?

That is correct.  If one ensured that all throws and catches were of
the same kind (-frtti or -fno-rtti), then everything would work.

Think of a large project, with one subsystem in one style, and the
other one in the other style and they don't interoperate or
communicate directly, but instead go through a plain C style
interface.  That is what was designed to work.  I didn't try and unify
the strings with the rtti information and do anything (other than
fault).

> Because there is no mechanism for telling whether you have a char*
> or a type_info*, right?

Right.

> It seems that you'd then need a different library entry instead of
> __cp_push_exception, to put a different matcher function into the
> exception info. Is that assumption correct?

There is a different matcher, I quoted it in my last email.  Yes, one
could have another __cp_push_exception function, call it, and have it
use the old matcher instead of the rtti matcher.


More information about the Gcc-bugs mailing list