This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: throwing C++ exceptions across C frames


I wrote:
However, if...

    - the C++ "catch" code calls some C function
    - this C function then calls back into C++ code
    - this C++ code now throws an exception

...then the exception is not caught
Err, instead of `the C++ "catch" code' I probably should have said `the C++ "try" code'.

The C code is called from within a "try" block, and the "catch" clause for that "try" block is not called to handle the exception:

C++: try { transfer(); } catch (...) { }
C: transfer() calls toss()
C++: toss() throws an exception


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]