C/C++
except.txt
Associated article: Exception Handling in C Without C++
Tags: C/C++ Embedded Systems
Published source code accompanying the article by Tom Schotland and Peter Petersen in which they discuss error handling, an important issue in embedded systems that can account for a substantial portion of a project's code. Our authors describe how they designed and implemented an exception handling library. Also see EXCEPT.ZIP.
Exception Handling in C Without C++
by Tom Schotland and Peter Petersen
Example 1:
jmp_buf jumper;
int SomeFunction(int a, int b)
{
if (b == 0) // can't divide by 0
longjmp(jumper, -3);
return a / b;
}
void main(void)
{
if (setjmp(jumper) == 0)
{
int ...


