ThePhD / future_cxx

Work done today for the glory of tomorrow - or, C and C++ systems programming papers.
https://thephd.dev/portfolio/standard
50 stars 8 forks source link

n3198 - Conditional Unwinding support #72

Closed ThePhD closed 4 months ago

ThePhD commented 10 months ago

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 commented 10 months ago

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

ThePhD commented 10 months ago

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

ThePhD commented 4 months ago

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++.