3 ms·
It seems unlikely that would happen. What would be the semantics of stack unwinding? C doesn't have destructors, so (as with longjmp) you end up losing track
by rwmj 11y ago
It seems unlikely that would happen. What would be the semantics of stack unwinding? C doesn't have destructors, so (as with longjmp) you end up losing track of memory allocations which were pointed to by the stack.
I do offer my own pet wish for C though: Official support for __attribute__((cleanup)). GCC and CLANG support it.
- avdicius 11y agoThe semantics would be nothing but executing the finally block. As a rule C programs do only what is explicitly coded. No high-level programming language behind the scenes stuff.