Unified · Split
| @@ -1,5 +1,26 @@ | ||
| 1 | 1 | #include <tcclib.h> |
| 2 | 2 | |
| 3 | +static int glob_i = 0; | |
| 4 | + | |
| 5 | +void incr_glob_i(int *i) | |
| 6 | +{ | |
| 7 | + glob_i += *i; | |
| 8 | +} | |
| 9 | + | |
| 10 | +#define INCR_GI { \ | |
| 11 | + int i __attribute__ ((__cleanup__(incr_glob_i))) = 1; \ | |
| 12 | + } | |
| 13 | + | |
| 14 | +#define INCR_GI0 INCR_GI INCR_GI INCR_GI INCR_GI | |
| 15 | +#define INCR_GI1 INCR_GI0 INCR_GI0 INCR_GI0 INCR_GI0 | |
| 16 | +#define INCR_GI2 INCR_GI1 INCR_GI1 INCR_GI1 INCR_GI1 | |
| 17 | +#define INCR_GI3 INCR_GI2 INCR_GI2 INCR_GI2 INCR_GI2 | |
| 18 | +#define INCR_GI4 INCR_GI3 INCR_GI3 INCR_GI3 INCR_GI3 | |
| 19 | +#define INCR_GI5 INCR_GI4 INCR_GI4 INCR_GI4 INCR_GI4 | |
| 20 | +#define INCR_GI6 INCR_GI5 INCR_GI5 INCR_GI5 INCR_GI5 | |
| 21 | +#define INCR_GI7 INCR_GI6 INCR_GI6 INCR_GI6 INCR_GI6 | |
| 22 | + | |
| 23 | + | |
| 3 | 24 | void check2(char **hum); |
| 4 | 25 | |
| 5 | 26 | void check(int *j) |
| @@ -103,7 +124,9 @@ int main() · 97 unmodified lines | ||
| 103 | 124 | __attribute__ ((__cleanup__(check_oh_i))) char oh_i = 'o', o = 'a'; |
| 104 | 125 | } |
| 105 | 126 | |
| 106 | − naaaaaaaa: | |
| 127 | + INCR_GI7; | |
| 128 | + printf("glob_i: %d\n", glob_i); | |
| 129 | + naaaaaaaa: | |
| 107 | 130 | if (!chk) { |
| 108 | 131 | __attribute__ ((__cleanup__(check_oh_i))) char oh_i = 'f'; |
| 109 | 132 | double __attribute__ ((__cleanup__(goto_hell))) f = 2.6; |
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | c: a |
| 2 | 2 | c: o |
| 3 | +glob_i: 65536 | |
| 3 | 4 | oo: 2.600000 |
| 4 | 5 | c: f |
| 5 | 6 | str: I don't think this should be print(but gcc got it wrong too) |