njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 1 | |
2 | #include <stdio.h> | ||||
3 | |||||
4 | /* Static and global vars are inited to zero, non-static local vars aren't. */ | ||||
5 | |||||
6 | int g; | ||||
7 | static int gs; | ||||
8 | |||||
9 | int main(void) | ||||
10 | { | ||||
11 | int l; | ||||
12 | static int ls; | ||||
13 | |||||
14 | if (gs == 0xDEADBEEF) printf("1!\n"); | ||||
15 | if (g == 0xDEADBEEF) printf("2!\n"); | ||||
16 | if (ls == 0xDEADBEEF) printf("3!\n"); | ||||
17 | if (l == 0xDEADBEEF) printf("4!\n"); // complains | ||||
18 | |||||
19 | return 0; | ||||
20 | } |