xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_072.c (revision e6298b924c5ba98f3a22919b56dab04a87cdbb1c)
1 /*	$NetBSD: msg_072.c,v 1.8 2023/07/07 19:45:22 rillig Exp $	*/
2 # 3 "msg_072.c"
3 
4 // Test for message: typedef declares no type name [72]
5 
6 /* lint1-extra-flags: -X 351 */
7 
8 /* expect+1: warning: typedef declares no type name [72] */
9 typedef int;
10 
11 typedef int number;
12 
13 /* expect+1: warning: typedef declares no type name [72] */
14 const typedef;
15 
16 void
cover_cgram_declaration(void)17 cover_cgram_declaration(void)
18 {
19 
20 	/* expect+1: warning: typedef declares no type name [72] */
21 	typedef const;
22 
23 	/* expect+1: warning: empty declaration [2] */
24 	const;
25 
26 	/* expect+1: warning: typedef declares no type name [72] */
27 	typedef int;
28 
29 	/* expect+1: warning: empty declaration [2] */
30 	int;
31 
32 	/* expect+1: error: syntax error 'missing base type for typedef' [249] */
33 	typedef not_a_type;
34 
35 	/* expect+1: error: old-style declaration; add 'int' [1] */
36 	static missing_type;
37 }
38