msg_215.c revision 1.8 1 /* $NetBSD: msg_215.c,v 1.8 2021/06/30 14:32:41 rillig Exp $ */
2 # 3 "msg_215.c"
3
4 // Test for message: function '%s' implicitly declared to return int [215]
5
6 /*
7 * In traditional C and C90, it was possible to implicitly declare a function
8 * by just calling it, without defining a prototype first. Such a function
9 * would then be defined as taking unspecified parameters and returning int.
10 */
11
12 struct str {
13 int dummy;
14 };
15
16 /* ARGSUSED */
17 void
18 test(struct str str)
19 {
20 /* expect+1: warning: function 'name' implicitly declared to return int [215] */
21 name();
22
23 /* expect+2: error: 'parenthesized' undefined [99] */
24 /* expect+1: error: illegal function (type int) [149] */
25 (parenthesized)();
26
27 /* expect+2: error: type 'struct str' does not have member 'member' [101] */
28 /* expect+1: error: illegal function (type int) [149] */
29 str.member();
30 }
31