• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Exception handling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exception handling


  • Subject: Re: Exception handling
  • From: Casey McDermott <email@hidden>
  • Date: Sat, 16 Jun 2018 18:37:04 +0000 (UTC)

BTW, raising an NSException inside a C++

try{}
catch(...){}

block also seems to work OK. It does get caught.

Casey McDermott

--------------------------------------------
On Sat, 6/16/18, Alastair Houghton <email@hidden> wrote:

 Subject: Re: Exception handling
 To: "Jens Alfke" <email@hidden>
 Cc: "Quincey Morris" <email@hidden>, "Casey McDermott"
<email@hidden>, "cocoa-dev list" <email@hidden>
 Date: Saturday, June 16, 2018, 10:25 AM

 On 15 Jun 2018, at 19:30, Jens
 Alfke <email@hidden>
 wrote:
 >
 >> On Jun 14, 2018,
 at 5:58 PM, Quincey Morris <email@hidden>
 wrote:
 >>
 >> as
 someone already mentioned, NSExceptions can’t successfully
 cross dylib/framework boundaries.
 >
 > They can, actually; there is no problem
 with this at the ABI/runtime level.
 >
 > I think what you mean is that most
 libraries/frameworks don't make guarantees about
 properly handling exceptions thrown into them, i.e. from a
 call into external code. Some C++ libraries do guarantee
 this (especially libc++), and even without guarantees a
 typical C++ lib using RAII will be relatively safe, but
 Objective-C code usually isn't written to be
 exception-safe, and C code of course can't be.

 Quite, though in principle
 there’s no reason C code couldn’t be exception safe,
 it’s just that there’s no language support for it
 (except on Windows where there are extensions to support
 SEH), so the C code would have to know about the relevant
 runtime data structures and associated behaviour.  In
 practice, it’s very unlikely you’d ever find
 exception-safe C code, except in a language runtime or -
 rarely - on Windows when it’s been written to use SEH.

 Kind regards,

 Alastair.

 --
 http://alastairs-place.net

_______________________________________________

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

  • Prev by Date: Re: Exception handling
  • Next by Date: Scrolling differences when using Trackpad or Mouse-Wheel
  • Previous by thread: Re: Exception handling
  • Next by thread: Scrolling differences when using Trackpad or Mouse-Wheel
  • Index(es):
    • Date
    • Thread