News for hackers. Stuff that matters.
Re:Exceptions in C with Longjmp and Setjmp by daeken on Sunday March 25, 2012 @06:05AM (#3752212)
Every call to a function that can throw an exception should have a try/catch block, so that things can be properly cleaned up. Global exception handlers are seldom useful outside of reporting the existence of an error for future usage.
Re:Exceptions in C with Longjmp and Setjmp by norswap on Monday March 26, 2012 @05:13AM (#3755759)
Kind of defeat the point of exceptions in the first place. It becomes more like an "enhance error return value" thing.

The thing about an exception is that you can't do about it in a number of scopes. When you encounter the exception you just just jump to the scope where you can do something about it.

Re:Exceptions in C with Longjmp and Setjmp by rwallace on Sunday March 25, 2012 @11:57AM (#3752886)
In that case, wouldn't it be simpler to explicitly check for error return on every call to such a function, and eliminate the need for an exception mechanism?
Re:Exceptions in C with Longjmp and Setjmp by sausagefeet on Sunday March 25, 2012 @06:07AM (#3752221)
But every function can potentially throw an exception...