Created
April 23, 2018 15:14
-
-
Save adrianparvino/e65c2694a821fded077fba3cc2097963 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_init() safeenv *res; _safe_init(senv) | |
#define safe_add(x, y, z) senv = _safe_add(senv, x, y, z); if (*senv == ERANGE); goto _safe_end; | |
#define safe_end() _safe_end: free(senv) | |
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