summaryrefslogtreecommitdiff
path: root/tests/usr.bin/xlint/lint1/msg_239.c
blob: 9d1eaf317eb05a7e30dcc74cc0fec27d9c9c98c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*	$NetBSD: msg_239.c,v 1.7 2023/07/07 19:45:22 rillig Exp $	*/
# 3 "msg_239.c"

// Test for message: constant argument to '!' [239]

/* lint1-extra-flags: -h -X 351 */

_Bool
example(int n)
{
	_Bool b;

	/* expect+2: warning: constant in conditional context [161] */
	/* expect+1: warning: constant argument to '!' [239] */
	b = !0;
	/* expect+2: warning: constant in conditional context [161] */
	/* expect+1: warning: constant argument to '!' [239] */
	b = !1;
	b = !(n > 1);

	return b;
}