Passing C++ exceptions through C code
Passing C++ exceptions through C code
- Subject: Passing C++ exceptions through C code
- From: Jesper Papmehl <email@hidden>
- Date: Fri, 19 Aug 2005 11:49:42 +0200
Hello!
I have some C++ code that calls some C code that in turn calls some C+
+ code. The "innermost" C++ code throws an exception that I want to
catch in the "outermost" C++ code.
When I run code that tries to do this, the implementation of throw
calls terminate(). It is as if all the C functions are marked as not
being able to handle exceptions.
Is there any way to change this? That is, to tell the compiler/
runtime that exceptions are allowed to "pass through" C functions?
I have worked around this by forcing Xcode to compile the .c files as
C++ files (by setting Compile Sources As to C++), but that causes
other problems (having to massage the C code enough to make the C++
compiler accept it, for example).
TIA
/Jesper Papmehl
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden