This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC: accessing exceptiond from C?
- From: Richard Henderson <rth at redhat dot com>
- To: Kai Henningsen <kaih at khms dot westfalen dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 30 Mar 2002 14:01:33 -0800
- Subject: Re: GCC: accessing exceptiond from C?
- References: <8LrUv-qHw-B@khms.westfalen.de>
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~