Exception trapping in C?

From: KKramsch (karlUNDERSCOREkramsch_at_yahooPERIODcom.invalid)
Date: 12/03/04


Date: Fri, 3 Dec 2004 18:02:02 +0000 (UTC)


One of the features from other languages that I miss most in C is
trappable exceptions. More specifically, I think it's great to be
able to demarcate a whole block of code where several exceptions
can happen at various points, so that any one of these exceptions
can be trapped and handled by the exception-handling code collected
in one place after the block. This also means that the exception
generating code can be much cleaner, since all it has to do is
raise the exception locally and bomb. In contrast, in traditional
C programming, many, if not all, function calls have to be surrounded
by error-checking and error-handling code. The error checking can
easily overwhelm the code.

Is there any way to implement something like C++'s try/catch
mechanism for exception trapping in C?

Thanks!

        Karl

-- 
Sent from a spam-bucket account; I check it once in a blue moon.  If
you still want to e-mail me, cut out the extension from my address,
and make the obvious substitutions on what's left.