>>> Just use @try and @catch. If you can find a smallish test case, please >>> file a bug on GitHub and I’ll take a look. Ideally, a test case shouldn’t >>> depend on anything other than libobjc2 - take a look at the existing EH >>> tests and see if you can make a similar one that shows the issue. >> >> I've been trying combinations of C++ and ObjC exceptions in a .mm file, and >> so far I haven't been able to reproduce the abort behavior. I've attached >> my latest code, which throws ObjC and C++ exceptions from C++ and ObjC >> classes, and catches them. Please let me know if you can think of any >> variations I haven't tried here. >> > > If the failure is what I suspect that it is, then it’s a problem caused by > mixing C++ and Objective-C exception unwinding, so it won’t be possible to > reproduce in a single file. You will need to throw an exception from > Objective-C++ and have it pass through stack frames from an Objective-C > compilation unit that includes an @finally block that runs some code, and > then be caught in an Objective-C++ compilation unit.
Ah, got it. I will try this. Would separate .o files linked into a single binary be sufficient for counting as separate compilation units? Or would it be better to compile and link a shared library, and pick it up at runtime? --David _______________________________________________ Discuss-gnustep mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnustep
