msg_274.c revision 1.4
1/*	$NetBSD: msg_274.c,v 1.4 2023/07/07 19:45:22 rillig Exp $	*/
2# 3 "msg_274.c"
3
4/* Test for message: ANSI C forbids comparison of %s with %s [274] */
5
6/* lint1-flags: -sw -X 351 */
7
8void
9example(void (*function_pointer)(void), void *void_pointer)
10{
11
12	/* Comparing a function pointer with a null pointer is OK. */
13	if (function_pointer == (void *)0)
14		return;
15
16	/* Comparing a function pointer with a null pointer is OK. */
17	if (function_pointer == (const void *)0)
18		return;
19
20	/* expect+1: warning: ANSI C forbids comparison of function pointer with 'void *' [274] */
21	if (function_pointer == void_pointer)
22		return;
23}
24