Re: c++ exceptions
Re: c++ exceptions
- Subject: Re: c++ exceptions
- From: Jens Alfke <email@hidden>
- Date: Tue, 16 Mar 2010 11:40:09 -0700
On Mar 16, 2010, at 8:37 AM, Joel Reymont wrote:
The worst case is where your code calls a system framework that
calls back into your code, and that bit of your code throws an
exception that’s caught by your outer code. The system code in the
middle gets unwound without being able to clean up, which can often
cause really nasty problems later on.
So how do you make sure this doesn't happen or code around it?
Ideally C++ would have the same kind of exception-checking that Java
does, so you could declare a function as not throwing any exception
and have the compiler enforce that for you. But C++ doesn't work that
way. So you just have to be careful to wrap all your entry points,
including callbacks, in try/catch blocks.
On Mar 16, 2010, at 10:54 AM, Chris Ridd wrote:
WebKit uses exceptions. I *think* I've seen exceptions coming back
from WebKit into Obj-C code, but I couldn't swear to it right now.
I am 99% certain WebKit does not use exceptions. I've developed inside
WebKit as late as last November, and don't remember seeing any code
that threw or caught exceptions. I think they're turned off with
compiler flags to reduce code size.
—Jens _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden