annotate test/func_conv_err.c @ 928:96c53f76b360

fix
author kono
date Sun, 13 Apr 2014 10:21:40 +0900
parents 5313ed059cee
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
388baa7d4bee more strict errors.
kono
parents:
diff changeset
3
622
682c8ec38d45 _code へ
kono
parents: 574
diff changeset
4 __code hoge()
572
388baa7d4bee more strict errors.
kono
parents:
diff changeset
5 {
388baa7d4bee more strict errors.
kono
parents:
diff changeset
6 goto hoge(); // ok
388baa7d4bee more strict errors.
kono
parents:
diff changeset
7 }
388baa7d4bee more strict errors.
kono
parents:
diff changeset
8
388baa7d4bee more strict errors.
kono
parents:
diff changeset
9 int
388baa7d4bee more strict errors.
kono
parents:
diff changeset
10 f()
388baa7d4bee more strict errors.
kono
parents:
diff changeset
11 {
388baa7d4bee more strict errors.
kono
parents:
diff changeset
12 return 1;
388baa7d4bee more strict errors.
kono
parents:
diff changeset
13 }
388baa7d4bee more strict errors.
kono
parents:
diff changeset
14
622
682c8ec38d45 _code へ
kono
parents: 574
diff changeset
15 __code hoga(int i)
572
388baa7d4bee more strict errors.
kono
parents:
diff changeset
16 {
388baa7d4bee more strict errors.
kono
parents:
diff changeset
17 f(); // ok
388baa7d4bee more strict errors.
kono
parents:
diff changeset
18 h(); // ok h() is a function
388baa7d4bee more strict errors.
kono
parents:
diff changeset
19 if (i)
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
20 goto f(); // bad
574
aad312f61654 remove too much inmode.
kono
parents: 572
diff changeset
21 else if(i-1)
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
22 goto g(i); // ok g() is a __code segement
574
aad312f61654 remove too much inmode.
kono
parents: 572
diff changeset
23 } // need goto bad
572
388baa7d4bee more strict errors.
kono
parents:
diff changeset
24
388baa7d4bee more strict errors.
kono
parents:
diff changeset
25 int
622
682c8ec38d45 _code へ
kono
parents: 574
diff changeset
26 g(int i) { // g is already used as __code bad
572
388baa7d4bee more strict errors.
kono
parents:
diff changeset
27 k();
388baa7d4bee more strict errors.
kono
parents:
diff changeset
28 if (i)
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 725
diff changeset
29 goto h(); // bad
572
388baa7d4bee more strict errors.
kono
parents:
diff changeset
30 // should complain.... no return value
388baa7d4bee more strict errors.
kono
parents:
diff changeset
31 }
388baa7d4bee more strict errors.
kono
parents:
diff changeset
32
622
682c8ec38d45 _code へ
kono
parents: 574
diff changeset
33 __code k() { // bad k is already used as function
572
388baa7d4bee more strict errors.
kono
parents:
diff changeset
34 goto hoge(); // ok
388baa7d4bee more strict errors.
kono
parents:
diff changeset
35 }
388baa7d4bee more strict errors.
kono
parents:
diff changeset
36
388baa7d4bee more strict errors.
kono
parents:
diff changeset
37 int
388baa7d4bee more strict errors.
kono
parents:
diff changeset
38 main()
388baa7d4bee more strict errors.
kono
parents:
diff changeset
39 {
388baa7d4bee more strict errors.
kono
parents:
diff changeset
40 hoge(); // bad
574
aad312f61654 remove too much inmode.
kono
parents: 572
diff changeset
41 return 0;
572
388baa7d4bee more strict errors.
kono
parents:
diff changeset
42 }
388baa7d4bee more strict errors.
kono
parents:
diff changeset
43