msg_075.c revision 1.7
1/*	$NetBSD: msg_075.c,v 1.7 2024/02/02 19:07:58 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';
36/* expect+1: warning: overflow in hex escape [75] */
37int wide_hex3 = L'\x100';
38/* expect+1: warning: overflow in hex escape [75] */
39int wide_hex4 = L'\xffff';
40/* expect+1: warning: overflow in hex escape [75] */
41int wide_hex5 = L'\xfffff';
42/* expect+1: warning: overflow in hex escape [75] */
43int wide_hex9 = L'\xfffffffff';
44
45char char_string_hex1[] = "\xf";
46char char_string_hex2[] = "\xff";
47/* expect+1: warning: overflow in hex escape [75] */
48char char_string_hex3[] = "\x100";
49/* expect+1: warning: overflow in hex escape [75] */
50char char_string_hex4[] = "\xffff";
51/* expect+1: warning: overflow in hex escape [75] */
52char char_string_hex5[] = "\xfffff";
53/* expect+1: warning: overflow in hex escape [75] */
54char char_string_hex9[] = "\xfffffffff";
55
56int wide_string_hex1[] = L"\xf";
57int wide_string_hex2[] = L"\xff";
58/* expect+1: warning: overflow in hex escape [75] */
59int wide_string_hex3[] = L"\x100";
60/* expect+1: warning: overflow in hex escape [75] */
61int wide_string_hex4[] = L"\xffff";
62/* expect+1: warning: overflow in hex escape [75] */
63int wide_string_hex5[] = L"\xfffff";
64/* expect+1: warning: overflow in hex escape [75] */
65int wide_string_hex9[] = L"\xfffffffff";
66