xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_156.c (revision 7d62b00eb9ad855ffcd7da46b41e23feb5476fac)
1 /*	$NetBSD: msg_156.c,v 1.7 2022/06/22 19:23:18 rillig Exp $	*/
2 # 3 "msg_156.c"
3 
4 // Test for message: function expects '%s', passing '%s' for arg #%d [156]
5 
6 enum color {
7 	RED	= 1 << 0,
8 	GREEN	= 1 << 1,
9 	BLUE	= 1 << 2
10 };
11 
12 enum size {
13 	SMALL,
14 	MEDIUM,
15 	LARGE
16 };
17 
18 void print_color(enum color);
19 
20 void
21 example(enum color c, enum size s)
22 {
23 	print_color(GREEN);
24 	print_color(c);
25 
26 	/* expect+1: warning: function expects 'enum color', passing 'enum size' for arg #1 [156] */
27 	print_color(MEDIUM);
28 	/* expect+1: warning: function expects 'enum color', passing 'enum size' for arg #1 [156] */
29 	print_color(s);
30 }
31