msg_215.c revision 1.5 1 /* $NetBSD: msg_215.c,v 1.5 2021/06/30 14:11:08 rillig Exp $ */
2 # 3 "msg_215.c"
3
4 // Test for message: function 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: error: function implicitly declared to return int [215] */
21 name();
22
23 /* expect+2: error: type 'struct str' does not have member 'member' [101] */
24 /* expect+1: error: illegal function (type int) [149] */
25 str.member();
26 }
27