msg_075.c revision 1.9
1/*	$NetBSD: msg_075.c,v 1.9 2024/02/03 18:58:05 rillig Exp $	*/
2# 3 "msg_075.c"
3
4// Test for message: overflow in hex escape [75]
5
6/* lint1-extra-flags: -X 351 */
7
8/*
9 * See also:
10 *	lex_char.c
11 *	lex_char_uchar.c
12 *	lex_string.c
13 *	lex_wide_char.c
14 *	lex_wide_string.c
15 */
16
17/* expect+1: warning: overflow in hex escape [75] */
18char str[] = "\x12345678123456781234567812345678";
19
20/* C11 6.4.4.4p7 */
21char leading_zeroes = '\x0000000000000000000000000000020';
22
23char char_hex1 = '\xf';
24char char_hex2 = '\xff';
25/* expect+1: warning: overflow in hex escape [75] */
26char char_hex3 = '\x100';
27/* expect+1: warning: overflow in hex escape [75] */
28char char_hex4 = '\xffff';
29/* expect+1: warning: overflow in hex escape [75] */
30char char_hex5 = '\xfffff';
31/* expect+1: warning: overflow in hex escape [75] */
32char char_hex9 = '\xfffffffff';
33
34int wide_hex1 = L'\xf';
35int wide_hex2 = L'\xff';
36int wide_hex3 = L'\x100';
37int wide_hex4 = L'\xffff';
38int wide_hex5 = L'\xfffff';
39/* expect+1: warning: overflow in hex escape [75] */
40int wide_hex9 = L'\xfffffffff';
41
42char char_string_hex1[] = "\xf";
43char char_string_hex2[] = "\xff";
44/* expect+1: warning: overflow in hex escape [75] */
45char char_string_hex3[] = "\x100";
46/* expect+1: warning: overflow in hex escape [75] */
47char char_string_hex4[] = "\xffff";
48/* expect+1: warning: overflow in hex escape [75] */
49char char_string_hex5[] = "\xfffff";
50/* expect+1: warning: overflow in hex escape [75] */
51char char_string_hex9[] = "\xfffffffff";
52
53int wide_string_hex1[] = L"\xf";
54int wide_string_hex2[] = L"\xff";
55int wide_string_hex3[] = L"\x100";
56int wide_string_hex4[] = L"\xffff";
57int wide_string_hex5[] = L"\xfffff";
58/* expect+1: warning: overflow in hex escape [75] */
59int wide_string_hex9[] = L"\xfffffffff";
60