GCC: accessing exceptiond from C?
Kai Henningsen
kaih@khms.westfalen.de
Sun Mar 31 05:48:00 GMT 2002
rth@redhat.com (Richard Henderson) wrote on 30.03.02 in <20020330140133.B20655@redhat.com>:
> On Sat, Mar 30, 2002 at 01:53:00PM +0200, Kai Henningsen wrote:
> > Is it currently (that is, in any version in CVS) possible to access the
> > gcc exception machinery from C (that is, throw and catch exceptions of
> > some kind), possibly via some builtins and/or libsupc++ routines?
>
> Throw, yes, by calling into either libsupc++ or libgcc_eh.
> Though it is greatly complicated by needing to set up the
> type of the exception properly. You're almost certainly
> better off writing this part in C++.
If that means having a small routine callable from C, that would do it, I
guess.
> Catch, no. That requires code generation assistance from
> the compiler.
That would be a problem, then. How hard is this?
> > If no, what would be needed for that? How much effort might that be?
>
> What do you want to do, exactly?
C with exceptions. I don't much care about details (as long as they can be
worked out at all), but catching is pretty much essential for this to be
useful.
MfG Kai
More information about the Gcc
mailing list