warn-missing-prototypes.c revision 73f35e60966855da052e61d8ee141b879351ffcb
1// RUN: clang -Wmissing-prototypes -fsyntax-only -Xclang -verify %s
2
3int f();
4
5int f(int x) { return x; } // expected-warning{{no previous prototype for function 'f'}}
6
7static int g(int x) { return x; }
8
9int h(int x) { return x; } // expected-warning{{no previous prototype for function 'h'}}
10
11static int g2();
12
13int g2(int x) { return x; }
14
15void test(void);
16
17int h3();
18int h4(int);
19int h4();
20
21void test(void) {
22  int h2(int x);
23  int h3(int x);
24  int h4();
25}
26
27int h2(int x) { return x; } // expected-warning{{no previous prototype for function 'h2'}}
28int h3(int x) { return x; } // expected-warning{{no previous prototype for function 'h3'}}
29int h4(int x) { return x; }
30
31int f2(int);
32int f2();
33
34int f2(int x) { return x; }
35
36// rdar://6759522
37int main(void) { return 0; }
38