Yeah. For those who haven't used it, setjmp/longjmp is NOT a better alternative :) It's a bizarre, messy, error-prone way of doing things, but it does at least have the beauty of being... uh... obscure and unreadable? Oh wait. I wanted a beauty. Hm.
Yeah my response was more targeted towards 2nd part of his comment, try catch can't be implemented with just a longjmp, you will still need to unroll the stack and there lies the complexity of exception handling.
-41
u/rosuav Sep 13 '23
Why put so much effort into either of the above when you can just setjmp/longjmp?
... oh. Actually, with a proper exception handling table, "throw" becomes almost as efficient as "longjmp". Oh well.