Use of setjmp and longjmp in C when linking to C++ libraries
问题 I would like to use setjmp and longjmp in a C program that links to a library that is implemented in C++ (but has a C API). The C++ code does do dynamic memory allocation and pointers get passed through the API, but as long as the C side of the code manages those (opaque) objects correctly, there shouldn't be any messing up when using longjmp, right? I know it's not safe to use these functions in C++ code, but should it be safe in C code that is linked to C++ code? 回答1: The fact that you call