warn-missing-prototypes.c revision 2c2d9dc382a561553a05bf0e96ab67e403beff09
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 36int main(void) { return 0; } 37