Mercurial > hg > CbC > CbC_gcc
annotate CbC-examples/rectypeTest/typedef3.cbc @ 108:7ad14f446135
add CbC-example/rectypeTest/
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 14 Jun 2012 20:30:24 +0900 |
parents | |
children |
rev | line source |
---|---|
108
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 typedef __code (*csPtr)(__rectype*); |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 #include <stdio.h> |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 __code cs_end(csPtr *p) |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 { |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 printf("end\n"); |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 } |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 __code cs(csPtr p) |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 { |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 csPtr *b; // <- This declaration please care. |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 goto p(b); |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 // goto p(3); // note: expected ‘void (**’ but argument is of type ‘int’ |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 } |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 int main() { |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 csPtr p; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 p = cs_end; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 goto cs(p); |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 return 0; |
7ad14f446135
add CbC-example/rectypeTest/
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 } |