summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wold-style-definition-1.c
blob: aa016338b5e8472f9d2caf6f3e3bfd1b9c3dc152 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Test for warning about old-style function definition.  */

/* Origin: Andreas Jaeger <aj@suse.de> */
/* { dg-do compile } */
/* { dg-options "-Wold-style-definition" } */

void
bar (a) int a; { } /* { dg-warning "old-style function definition" } */

void bar1 () {} /* { dg-warning "old-style function definition" } */

extern void bar2 (void);

void bar2 () {} /* { dg-warning "old-style function definition" } */

extern void bar3 (int);

void bar3 (a) {} /* { dg-warning "old-style function definition" } */

void bar4 (a) {} /* { dg-warning "old-style function definition" } */

void bar5 (int a) {}

void bar6 (void) {}