0
|
1 #include"my-stdio.h"
|
|
2
|
|
3 #define OBJECT_MAXNUM 10
|
|
4
|
|
5 #define _BUG
|
|
6
|
|
7 #ifdef _BUG
|
|
8 struct {
|
|
9 float j; // bug
|
|
10 int i;
|
|
11 int k;
|
|
12 int h;
|
|
13 } a[OBJECT_MAXNUM];
|
|
14
|
|
15 #else
|
|
16
|
|
17 struct {
|
|
18 int i;
|
|
19 int j;
|
|
20 int k;
|
|
21 int h;
|
|
22 } a[OBJECT_MAXNUM];
|
|
23 #endif // _BUG
|
|
24
|
|
25 code
|
|
26 print_a(int i,code(*ret)(int),void *env)
|
|
27 {
|
|
28 if(i<OBJECT_MAXNUM){
|
|
29 #ifdef _BUG
|
|
30 printf("a[%d]: i=%d j=%f k=%d h=%d\n", i, a[i].i,a[i].j,a[i].k,a[i].h);
|
|
31 #else
|
|
32 printf("a[%d]: i=%d j=%d k=%d h=%d\n", i, a[i].i,a[i].j,a[i].k,a[i].h);
|
|
33 #endif
|
|
34 i++;
|
|
35 goto print_a(i,ret,env);
|
|
36 }
|
|
37 goto ret(0),env;
|
|
38 }
|
|
39
|
|
40 code
|
|
41 init_a(int i,code(*ret)(int),void *env)
|
|
42 {
|
|
43 if(i<OBJECT_MAXNUM){
|
|
44 a[i].i=1;
|
|
45 a[i].j=2;
|
|
46 a[i].k=3;
|
|
47 a[i].h=4;
|
|
48 i++;
|
|
49 goto init_a(i,ret,env);
|
|
50 }
|
|
51 goto print_a(0,ret,env);
|
|
52 }
|
|
53
|
|
54 int
|
|
55 main()
|
|
56 {
|
|
57 goto init_a(0,return,environment);
|
|
58 return(0);
|
|
59 }
|