Mercurial > hg > CbC > old > device
comparison test/tmp11.c @ 46:b1c8ac8c308d
fix cascading struct retrun. Now it should be compatible with gcc
calling sequence.
author | kono |
---|---|
date | Sat, 15 Feb 2003 17:54:30 +0900 |
parents | |
children | 096559f07a70 |
comparison
equal
deleted
inserted
replaced
45:b9266c88495c | 46:b1c8ac8c308d |
---|---|
1 typedef struct nametable { | |
2 char *nm; | |
3 int sc,ty,dsp; } NMTBL; | |
4 NMTBL *a; | |
5 | |
6 NMTBL * | |
7 test2(char *n) { | |
8 printf("s %s\n",n); | |
9 return a; | |
10 } | |
11 | |
12 int | |
13 test0(int a,int b,int c) { | |
14 printf("a %d b %d c %d\n",a,b,c); | |
15 return 4; | |
16 } | |
17 | |
18 int | |
19 test1(a,b,c) | |
20 int a,b;int c; | |
21 { | |
22 return test0(a,b,c); | |
23 } | |
24 | |
25 int | |
26 main() | |
27 { | |
28 int d; | |
29 NMTBL *b; | |
30 b = test2("test"); | |
31 d = test1(1,2,3); | |
32 printf("return %d\n",d); | |
33 return d; | |
34 } |