Re: c++ exceptions in objective c call stack
Re: c++ exceptions in objective c call stack
- Subject: Re: c++ exceptions in objective c call stack
- From: "Clark Cox" <email@hidden>
- Date: Sat, 5 Jul 2008 10:52:41 -0700
On Sat, Jul 5, 2008 at 10:11 AM, Uli Kusterer
<email@hidden> wrote:
> On 05.07.2008, at 17:01, Jim Crafton wrote:
>>>
>>> You cannot throw C++ exceptions across Objective-C functions. If you want
>>> to
>>> catch this exception, you will have to catch it in drawRect, and decide
>>> there what to do with it.
>>
>> The earlier emails seem to mention that for 64bit apps this will not
>> be a problem. Is that the case or did I misunderstand them?
>
> Well, define "problem": Of course, most C++ code will not try to catch or
> re-throw anything but std::exception-based exceptions, so you might still
> get odd behaviour because there's an NSException* thrown, or it'll just show
> up as an "unknown exception".
If C++ code behaves oddly in the presence of unknown exceptions, then
that C++ code is broken. :)
> But yeah, it won't trash your stack on 64-bit
> if you throw from C++ through ObjC or ObjC++. Of course, if you throw
> *anything* through straight C, it will still cause problems. But that's that
> way for any C++, ObjC or longjmp that marches through straight C code.
--
Clark S. Cox III
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden