I\'ve got C++ functions that I want to declare using extern \"C\" even though they are only called in C++ code. Yes, I know this is strange but it\'s something
it will compile but it is undefined behavior to throw from function marked as having C linkage. C doesn't have exceptions, therefore in general you should just return an error code and/or provide a function that returns the information about the last error.
#include
extern "C" void foo() {throw std::exception();}
compiles well