msg_196.c revision 1.5 1 /* $NetBSD: msg_196.c,v 1.5 2025/02/27 06:23:07 rillig Exp $ */
2 # 3 "msg_196.c"
3
4 // Test for message: case label is converted from '%s' to '%s' [196]
5
6 /* lint1-extra-flags: -X 351 */
7
8 // C23 6.8.5.3p5 says: [...] The constant expression in each case label is
9 // converted to the promoted type of the controlling expression. [...]
10
11 void
12 switch_int_unsigned(int x)
13 {
14 switch (x) {
15 /* expect+1: warning: case label is converted from 'unsigned int' to 'int' [196] */
16 case (unsigned int)-1:
17 /* expect+1: warning: case label is converted from 'unsigned int' to 'int' [196] */
18 case -2U:
19 /* expect+1: warning: case label is converted from 'unsigned long long' to 'int' [196] */
20 case 0x1000200030004000ULL:
21 return;
22 }
23 }
24