Debian Codegraph @

gcc/testsuite/gcc.dg/Wdeprecated-non-prototype-3.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-std=gnu17 -Wdeprecated-non-prototype -Wno-declaration-missing-parameter-type" } */
3
4 void f1 (not_a_type); /* { dg-note "declared here" } */
5 void f2 (not_a_type); /* { dg-note "declared here" } */
6
7 void
8 g ()
9 {
10 /* This is not ideal, but the GCC type system does not capture the number of
11 arguments in a non-prototype function declaration. */
12 f1 (1); /* { dg-warning "does not allow arguments for function" } */
13 }
14
15 void
16 f2 (int not_a_type) /* { dg-warning "does not allow defining parameters" } */
17 {
18 }