This is the mail archive of the gcc-patches@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: [RFC] C++ vs forced unwinding


On 10-Apr-2003, Mark Mitchell <mark at codesourcery dot com> wrote:
> On Wed, 2003-04-09 at 05:16, Jason Merrill wrote:
> > The point was to play nice with C++; the question is what that means in
> > this situation.  I don't think it's clear what the right answer is.
> 
> True.
> 
> I thought longjmp_unwind was going to be treated like a foreign
> exception.  In other words, precisely as if you called a Java routine
> which threw an exception which (by hypothesis) is totally uncatchable by
> C++, except by the matching setjmp.

What about `catch (...)', which can catch any exception?
Or are you suggesting that C++'s `catch (...)' should only
be able to catch C++ exceptions, not exceptions from some other language?

> What happens if there's a "throw ()" in the way when a foreign exception
> is thrown?  I'm betting we call terminate.
> 
> I guess I'd be OK with doing that for longjmp_unwind.

I agree.

> I don't much like your terminate->longjmp conversion at first blush.  If
> we can't get back to the setjmp point safely (i.e., destroying
> everything along the way), it's probably better just to crash.

I agree.

-- 
Fergus Henderson <fjh at cs dot mu dot oz dot au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


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