diff --git a/example.c b/example.c index 4fb79ab..2534006 100644 --- a/example.c +++ b/example.c @@ -37,7 +37,6 @@ main() try { puts("try2"); } catch (ex) { - (void)ex; puts("this should not be called"); } @@ -50,7 +49,6 @@ main() throw(1); return 1; } catch (ex) { - (void)ex; } return 0; diff --git a/trycatch.h b/trycatch.h index 9a7ce89..23c5c07 100644 --- a/trycatch.h +++ b/trycatch.h @@ -45,9 +45,9 @@ 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)