Closed ThePhD closed 4 months ago
Current standard paper: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3198.htm
This paper is going to need a lot to improve it (see: e-mail from Joseph Myers on n3198).
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++.
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