summaryrefslogtreecommitdiff
path: root/tests/usr.bin/xlint/lint1/msg_337.c
blob: 2e2cb78a53d976e689035812c1ac419d6eed9585 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*	$NetBSD: msg_337.c,v 1.5 2023/03/28 14:44:35 rillig Exp $	*/
# 3 "msg_337.c"

// Test for message: right operand of '%s' must not be bool [337]
//
// See d_c99_bool_strict.c for many more examples.

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

typedef _Bool bool;

void
test(bool);

void
example(bool b, int i)
{
	/* expect+2: error: right operand of '+' must not be bool [337] */
	/* expect+1: error: argument #1 expects '_Bool', gets passed 'int' [334] */
	test(i + b);

	test(b);

	test(i != 0);
}