forked from ShivamSarodia/ShivyC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeclaration.c
More file actions
46 lines (33 loc) · 698 Bytes
/
declaration.c
File metadata and controls
46 lines (33 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Verify we can declare variables before and after main
extern int a;
int f0(int[5], int());
int f1(void);
int f2();
int f4(int a, int b, int c) { return 0; }
int func(int a, int b) {
a; b;
return a;
}
// Test declaration of function returning function.
int (*getFunc(int z))(int a, int b) {
z;
return func;
}
int main() {
int;
int b = 3 + 4;
int arr[3], (*c)[3] = &arr, *d[3], e = 2;
(*c)[e];
d[e] = &b;
*d[e];
int *f(int, unsigned int* b, long *[5], long (*)[5]);
int g();
int h(void);
int *i();
int *j(int);
int *k(int(int));
// verify pointer to function and decayed function are compatible
int (*f3)(int, int, int);
f3 = f4;
}
extern int z;