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?


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


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