Index: example.c ================================================================== --- example.c +++ example.c @@ -35,11 +35,10 @@ puts("try1"); try { puts("try2"); } catch (ex) { - (void)ex; puts("this should not be called"); } throw(5); } catch (ex) { @@ -48,10 +47,9 @@ try { throw(1); return 1; } catch (ex) { - (void)ex; } return 0; } Index: trycatch.h ================================================================== --- trycatch.h +++ trycatch.h @@ -43,13 +43,13 @@ trycatch_ex = setjmp(TRYCATCH_CONCAT(trycatch_jmpbuf, __LINE__)); \ if (trycatch_ex == 0) \ TRYCATCH_CONCAT(trycatch_frame, __LINE__)->jmpbuf = \ &TRYCATCH_CONCAT(trycatch_jmpbuf, __LINE__); \ if (trycatch_ex == 0) -#define catch(ex) \ - trycatch_frame_pop(); \ - for (int ex = trycatch_ex; trycatch_ex != 0; trycatch_ex = 0) +#define catch(ex) \ + trycatch_frame_pop(); \ + for (int ex = trycatch_ex; trycatch_ex != 0; trycatch_ex = 0, (void)ex) #define throw(ex) trycatch_throw(ex) #define rethrow trycatch_throw(trycatch_ex) struct trycatch_frame { jmp_buf *jmpbuf;