Mercurial > hg > CbC > old > device
annotate test/func_conv_err.c @ 880:5313ed059cee
no tabs in source
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 03 Apr 2014 10:43:01 +0900 |
parents | 3f1f6c0610c1 |
children |
rev | line source |
---|---|
725
3f1f6c0610c1
goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
622
diff
changeset
|
1 #define __environment _CbC_environment |
3f1f6c0610c1
goto with enviornment syntax changed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
622
diff
changeset
|
2 #define __return _CbC_return |
572 | 3 |
622 | 4 __code hoge() |
572 | 5 { |
6 goto hoge(); // ok | |
7 } | |
8 | |
9 int | |
10 f() | |
11 { | |
12 return 1; | |
13 } | |
14 | |
622 | 15 __code hoga(int i) |
572 | 16 { |
17 f(); // ok | |
18 h(); // ok h() is a function | |
19 if (i) | |
880 | 20 goto f(); // bad |
574 | 21 else if(i-1) |
880 | 22 goto g(i); // ok g() is a __code segement |
574 | 23 } // need goto bad |
572 | 24 |
25 int | |
622 | 26 g(int i) { // g is already used as __code bad |
572 | 27 k(); |
28 if (i) | |
880 | 29 goto h(); // bad |
572 | 30 // should complain.... no return value |
31 } | |
32 | |
622 | 33 __code k() { // bad k is already used as function |
572 | 34 goto hoge(); // ok |
35 } | |
36 | |
37 int | |
38 main() | |
39 { | |
40 hoge(); // bad | |
574 | 41 return 0; |
572 | 42 } |
43 |