xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_246.c (revision e6298b924c5ba98f3a22919b56dab04a87cdbb1c)
1 /*	$NetBSD: msg_246.c,v 1.5 2023/07/07 19:45:22 rillig Exp $	*/
2 # 3 "msg_246.c"
3 
4 // Test for message: dubious conversion of enum to '%s' [246]
5 // This message is not used.
6 
7 /* lint1-extra-flags: -X 351 */
8 
9 enum color {
10 	RED, GREEN, BLUE
11 };
12 
13 double
to_double(enum color c)14 to_double(enum color c)
15 {
16 	return c;
17 }
18 
19 void *
to_pointer(enum color c)20 to_pointer(enum color c)
21 {
22 	/* expect+1: warning: illegal combination of pointer 'pointer to void' and integer 'enum color' [183] */
23 	return c;
24 }
25