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