int SETJMP(JMP_BUF buf);
'buf' has to be a local variable
There are some limitations to how you can use local variables in the same function as setjump/longjump. See setjup(3) for more details.
void do_catch() {