Home | History | Annotate | Line # | Download | only in lint1
msg_215.c revision 1.13
      1  1.13  rillig /*	$NetBSD: msg_215.c,v 1.13 2023/07/07 19:45:22 rillig Exp $	*/
      2   1.1  rillig # 3 "msg_215.c"
      3   1.1  rillig 
      4   1.7  rillig // Test for message: function '%s' 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.13  rillig /* lint1-extra-flags: -X 351 */
     13  1.13  rillig 
     14   1.4  rillig struct str {
     15   1.4  rillig 	int dummy;
     16   1.4  rillig };
     17   1.4  rillig 
     18   1.4  rillig /* ARGSUSED */
     19   1.3  rillig void
     20  1.10  rillig test(struct str str, const double *p_double)
     21   1.3  rillig {
     22  1.11  rillig 	/* expect+1: error: function 'name' implicitly declared to return int [215] */
     23   1.4  rillig 	name();
     24   1.4  rillig 
     25   1.6  rillig 	/* expect+2: error: 'parenthesized' undefined [99] */
     26  1.12  rillig 	/* expect+1: error: cannot call 'int', must be a function [149] */
     27   1.6  rillig 	(parenthesized)();
     28   1.6  rillig 
     29   1.5  rillig 	/* expect+2: error: type 'struct str' does not have member 'member' [101] */
     30  1.12  rillig 	/* expect+1: error: cannot call 'int', must be a function [149] */
     31   1.4  rillig 	str.member();
     32   1.9  rillig 
     33   1.9  rillig 	/* https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html */
     34   1.9  rillig 	__builtin_whatever(123, "string");
     35   1.9  rillig 	__atomic_whatever(123, "string");
     36  1.10  rillig 	/* obsolete but still in use, as of 2021 */
     37  1.10  rillig 	__sync_whatever(123, "string");
     38  1.10  rillig 
     39  1.10  rillig 	/* https://software.intel.com/sites/landingpage/IntrinsicsGuide/ */
     40  1.10  rillig 	_mm_load_sd(p_double);
     41   1.3  rillig }
     42