Jump to content
  • Advertisement
Sign in to follow this  
XXX_Andrew_XXX

c code throwing exceptions (gcc)

This topic is 4538 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!