Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22032

is it possible to execute C code during C++ stack unwinding / exception

$
0
0

I need to write a C library which will be integrated into a C++ code base. This library may call C++ code passed as a callback. These functions may throw C++ exceptions.

I'd like to ensure that the cleanup code is run during the stack unwinding process. I could use the cleanup attribute to ensure that:

If -fexceptions is enabled, then cleanup_function is run during the stack unwinding that happens during the processing of the exception.

From the GCC docs.

Unfortunately I can't use the cleanup attribute. I'd like to register the cleanup function to be run during stack unwinding programmatically using portable C.

Is this possible?


Viewing all articles
Browse latest Browse all 22032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>