xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_164.c (revision dd3ee07da436799d8de85f3055253118b76bf345)
1 /*	$NetBSD: msg_164.c,v 1.4 2021/08/14 12:46:24 rillig Exp $	*/
2 # 3 "msg_164.c"
3 
4 // Test for message: assignment of negative constant to unsigned type [164]
5 
6 void
7 example(void)
8 {
9 	/* expect+1: warning: initialization of unsigned with negative constant [221] */
10 	unsigned char uch = -3;
11 
12 	uch = -5;			/* expect: 164 */
13 	uch += -7;			/* expect: 222 */
14 	uch *= -1;			/* expect: 222 */
15 }
16