-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.c
70 lines (54 loc) · 858 Bytes
/
example.c
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <stdio.h>
int a = 1, b = 2;
int a;
// error: conflicting types for 'a'; have 'float'
// float a;
// error: syntax error, expected ...
// {}
int test(), test2(), x = 3;
// error: function 'test' is initialized like a variable
// int z, test() = 3;
int main()
{
int a;
int b = 3, c;
// error: redeclaration of 'a'
// int a;
// error: redefinition of 'a'
// int a = 2;
while (1)
;
while (0)
continue;
while (0)
break;
while (1)
{
int a = 2;
while (2)
{
int a = 3;
while (3)
{
break;
}
break;
}
continue;
}
// error: continue statement not within a loop
// continue;
// error: break statement not within loop or switch
// break;
{
int a, b;
{
{
{
while (1)
a;
}
}
}
}
}