Created
April 23, 2018 15:19
-
-
Save adrianparvino/190c59d6aa64cfabed2e24f98f824738 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define safe_wrap(f) senv = f(senv, x, y, z); if (senv == ERANGE); goto _safe_end; | |
#define safe_init() safeenv res; _safe_init(&senv) | |
#define safe_add(x, y, z) safe_wrap(_safeadd) | |
#define safe_end() _safe_end: | |
int foo () | |
{ | |
int a, b, c, d; | |
safe_init(); | |
safe_add(a, b, &d); | |
safe_add(d, c, &d); | |
safe_end(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment