future_cxx icon indicating copy to clipboard operation
future_cxx copied to clipboard

n3198 - Conditional Unwinding support

Open ThePhD opened this issue 1 year ago • 2 comments

There's a smattering of existing practice where there is support for invoking things like destructors or __attribute__((cleanup(…))) functionality when leaving a specific scope of execution by various means. We capture that in a paper that will attempt to give C code a way to detect whether or not specific constructors are available (at run-time, not compile-time).

Latest draft: https://thephd.dev/_vendor/future_cxx/papers/C%20-%20Unwinding.html

ThePhD avatar Jan 14 '24 20:01 ThePhD

Current standard paper: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3198.htm

ThePhD avatar Jan 14 '24 20:01 ThePhD

This paper is going to need a lot to improve it (see: e-mail from Joseph Myers on n3198).

ThePhD avatar Jan 14 '24 20:01 ThePhD

This paper is closed down and won't be pursued at all. Unwinding is WAY too complex and difficult to do, especially for signal support. Any mechanism for resource safety in combination with defer needs to be made by the user, especially since the things we are trying to protect against (Signals, longjmp, exit, etc.) are all things that CURRENTLY have no protection in either C OR C++.

ThePhD avatar Aug 01 '24 16:08 ThePhD