xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_229.c (revision e6298b924c5ba98f3a22919b56dab04a87cdbb1c)
1 /*	$NetBSD: msg_229.c,v 1.7 2023/07/07 19:45:22 rillig Exp $	*/
2 # 3 "msg_229.c"
3 
4 // Test for message: converting '%s' to '%s' is questionable [229]
5 
6 /* lint1-extra-flags: -X 351 */
7 
8 typedef double (*unary_operator)(double);
9 
10 int *
to_int_pointer(unary_operator op)11 to_int_pointer(unary_operator op)
12 {
13 	/* expect+1: warning: converting 'pointer to function(double) returning double' to 'pointer to int' is questionable [229] */
14 	return (int *)op;
15 }
16 
17 unary_operator
to_function_pointer(int * p)18 to_function_pointer(int *p)
19 {
20 	/* expect+1: warning: converting 'pointer to int' to 'pointer to function(double) returning double' is questionable [229] */
21 	return (unary_operator)p;
22 }
23