This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC: accessing exceptiond from C?


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++.

Catch, no.  That requires code generation assistance from
the compiler.

> If no, what would be needed for that? How much effort might that be?

What do you want to do, exactly?

I've been talking to Uli Drepper about implementing Java's
try/finally for C, since he only needs cleanups, and it avoids
the issue of coordinating with the type system of another
language.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]