Mercurial > hg > CbC > CbC_examples
annotate tmp4.c @ 5:90e6146d24cd
fix stack1.c
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 22 Oct 2014 19:02:57 +0900 |
parents | 175041088754 |
children | 586096c45873 |
rev | line source |
---|---|
2
35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1 #ifdef GCC |
0 | 2 #define __environment _CbC_environment |
3 #define __return _CbC_return | |
2
35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
4 #endif |
0 | 5 |
6 #include "stdio.h" | |
7 | |
2
35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
8 int main0(int ac,char *av[]); |
35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
9 __code code0(int i,int j,int k,char *av[],__code (*ret)(int,void*),void*retenv); |
35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
10 __code code1(int i,int j,int k,char *av[],__code(*ret)(int,void*),void*retenv); |
35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
11 __code code2(int i,int j,int k,char *av[],__code (*ret)(int, void*),void *retenv); |
35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
12 |
0 | 13 int |
2
35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
14 main(int ac,char *av[]) |
0 | 15 { |
16 int i; | |
17 i=main0(ac,av); | |
18 fprintf(stdout,"#0012:1: %s %d\n",av[0]+2,i); | |
19 return 0; | |
20 } | |
21 | |
22 int | |
2
35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
23 main0(int ac,char *av[]) |
0 | 24 { |
25 int i,j,k; | |
26 i=123; | |
27 j=456; | |
28 k=789; | |
29 fprintf(stdout,"#0025:2: %s\n",av[0]+2); | |
30 goto code0(i,j,k,av,__return,__environment); | |
4 | 31 return 0; |
0 | 32 } |
33 | |
2
35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
34 __code code0(int i,int j,int k,char *av[],__code (*ret)(int,void*),void*retenv) |
0 | 35 { |
36 char *p; | |
37 p = av[0]+2; | |
38 fprintf(stdout,"#0037:3: i=%d j=%d k=%d av[0]=%s p=%s\n",i,j,k,av[0]+2,p); | |
39 goto code1(i,j,k,av,ret,retenv); | |
40 } | |
41 | |
2
35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
42 __code code1(int i,int j,int k,char *av[],__code(*ret)(int,void*),void*retenv) |
0 | 43 { |
44 fprintf(stdout,"#0047:4: %s\n",av[0]+2); | |
45 goto code2(i,j,k,av,ret,retenv); | |
46 } | |
47 | |
2
35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
48 __code code2(int i,int j,int k,char *av[],__code (*ret)(int,void*),void *retenv) |
0 | 49 { |
50 fprintf(stdout,"#0057:5: %s\n",av[0]+2); | |
51 fprintf(stdout,"#0058:5: i=%d j=%d k=%d\n",i,j,k); | |
52 goto (*ret)(1234,retenv); | |
53 } |