tccgen.c: fix warning for incompatible struct- and function pointers
[tinycc.git] / tests / tests2 / 60_errors_and_warnings.c
blobb32a3db1bc8d584ef619e865e5b75e99a76c26f0
1 #if defined test_56_btype_excess_1
2 struct A {} int i;
4 #elif defined test_57_btype_excess_2
5 char int i;
7 #elif defined test_58_function_redefinition
8 int f(void) { return 0; }
9 int f(void) { return 1; }
11 #elif defined test_global_redefinition
12 int xxx = 1;
13 int xxx;
14 int xxx = 2;
16 #elif defined test_59_function_array
17 int (*fct)[42](int x);
19 #elif defined test_60_enum_redefinition
20 enum color { RED, GREEN, BLUE };
21 enum color { R, G, B };
22 enum color c;
24 #elif defined test_62_enumerator_redefinition
25 enum color { RED, GREEN, BLUE };
26 enum rgb { RED, G, B};
27 enum color c = RED;
29 #elif defined test_63_local_enumerator_redefinition
30 enum {
31 FOO,
32 BAR
35 int main(void)
37 enum {
38 FOO = 2,
39 BAR
42 return BAR - FOO;
45 #elif defined test_61_undefined_enum
46 enum rgb3 c = 42;
48 #elif defined test_74_non_const_init
49 int i = i++;
51 #elif defined test_pointer_assignment
53 void (*f1)(void);
54 void f2(void) {}
56 struct s1 *ps1;
57 struct s2 *ps2;
59 void *v1, **v2, ***v3;
61 enum e1 { a = 4 } e10, *e11, *e12;
62 enum e2 { b = -4 } e20, *e21;
63 enum e3 { c = 5000000000LL } e30;
65 int *ip;
66 unsigned int *up;
67 long *lp;
68 long long *llp;
70 char **c1;
71 char const **c2;
72 unsigned char **u1;
74 int no_main ()
76 // function
77 f1 = f2;
78 // struct
79 ps1 = ps2;
80 // void*
81 v1 = v3;
82 v2 = v3;
84 // enum
85 e11 = e12;
86 e11 = e21;
87 e11 = &e10;
88 ip = &e10;
89 ip = &e20;
90 up = &e10;
91 up = &e20;
92 up = &e30;
94 lp = ip;
95 lp = llp;
97 // constness
98 c1 = c2;
99 *c1 = *c2;
100 **c1 = **c2;
102 // unsigned = signed
103 u1 = c2;
104 *u1 = *c2;
105 **u1 = **c2;
107 c2 = c1;
108 *c2 = *c1;
109 **c2 = **c1;
111 return 0;
115 #elif defined test_enum_compat
116 enum e4;
117 enum e5;
118 void f3(enum e4 e);
119 void f3(enum e5 e);
121 #endif