Sign in to follow this  

c code throwing exceptions (gcc)

This topic is 4381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my current project we have some legacy mixed language code that is crashing. We isolated it to a piece of code where c function calls a c++ function which throws an exception. This crashes (I assume) because the c functions stack frame isn't setup correctly. With the microsoft compiler you can work around this with the /EH** compiler options, but does anyone know how to the same thing with gcc?

Share this post


Link to post
Share on other sites
Bugger, I spend all morning trying to find an answer, post my question and then find the answer five minutes later

if anyone was interested you need to enable -fexceptions

Share this post


Link to post
Share on other sites
is it possible to write a c++ wrapper function that has c-linkage, and catch the exceptions and convert them into return codes or some such, or are the functions part of a library you can't edit?

Share this post


Link to post
Share on other sites

This topic is 4381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this