Home | History | Annotate | Line # | Download | only in lint2
msg_000.ln revision 1.6
      1  1.6  rillig # $NetBSD: msg_000.ln,v 1.6 2025/02/20 19:04:00 rillig Exp $
      2  1.1  rillig #
      3  1.1  rillig # Test data for message 0 of lint2:
      4  1.6  rillig #	%s is used in %s but never defined
      5  1.1  rillig #
      6  1.1  rillig 
      7  1.1  rillig # Define file number 0.
      8  1.2  rillig 0 s msg_000.c
      9  1.1  rillig 
     10  1.1  rillig # Define the main file of the translation unit.
     11  1.2  rillig S msg_000.c
     12  1.1  rillig 
     13  1.1  rillig # Have a function that is used but not defined, and a function that is defined
     14  1.1  rillig # but not used, generated by this code:
     15  1.1  rillig #	1:	# 2 "msg_000.c"
     16  1.1  rillig #	2:	defined_not_used() {
     17  1.3  rillig #	3:		used_not_defined(12345, 0.0);
     18  1.1  rillig #	4:	}
     19  1.1  rillig #
     20  1.1  rillig # The function call in line 3 generates this entry:
     21  1.1  rillig #	'3'	logical line 3 in the main .c source
     22  1.1  rillig #	'c'	function call
     23  1.1  rillig #	'0.3'	file 0, logical line 3 in the currently included file
     24  1.3  rillig #	'p1'	argument 1 is a positive constant
     25  1.1  rillig #	'i'	the return value of the function call is ignored
     26  1.1  rillig #	'16...'	the name of the called function
     27  1.4  rillig #	'f2'	the function is called with 2 arguments
     28  1.1  rillig #	'I'	the first argument has type 'int'
     29  1.1  rillig #	'D'	the first argument has type 'double'
     30  1.1  rillig #	'I'	the return type of the function is (implicitly) 'int'
     31  1.2  rillig 3 c 0.3 p1 i 16used_not_defined f2 I D I
     32  1.1  rillig #
     33  1.1  rillig # The function definition in line 2 generates this entry:
     34  1.1  rillig #	'2'	logical line 2 in the main .c source
     35  1.1  rillig #	'd'	function definition
     36  1.1  rillig #	'0.2'	file 0, logical line 2 in the currently included file
     37  1.1  rillig #	'd'	function definition
     38  1.1  rillig #	'o'	old-style function definition
     39  1.1  rillig #	'16...'	the name of the defined function
     40  1.5  rillig #	'f0'	it's a function with 0 parameters
     41  1.1  rillig #	'I'	the return type of the function is (implicitly) 'int'
     42  1.2  rillig 2 d 0.2 d o 16defined_not_used f0 I
     43