1*2b097c75Srillig /* $NetBSD: msg_075.c,v 1.10 2024/02/03 19:18:36 rillig Exp $ */ 2a0a15c14Srillig # 3 "msg_075.c" 3a0a15c14Srillig 4a0a15c14Srillig // Test for message: overflow in hex escape [75] 5a0a15c14Srillig 6b2baa501Srillig /* lint1-extra-flags: -X 351 */ 7b2baa501Srillig 80ad5a709Srillig /* 90ad5a709Srillig * See also: 100ad5a709Srillig * lex_char.c 110ad5a709Srillig * lex_char_uchar.c 120ad5a709Srillig * lex_string.c 130ad5a709Srillig * lex_wide_char.c 140ad5a709Srillig * lex_wide_string.c 150ad5a709Srillig */ 160ad5a709Srillig 17aba9ec72Srillig /* expect+1: warning: overflow in hex escape [75] */ 18aba9ec72Srillig char str[] = "\x12345678123456781234567812345678"; 190ad5a709Srillig 200ad5a709Srillig /* C11 6.4.4.4p7 */ 210ad5a709Srillig char leading_zeroes = '\x0000000000000000000000000000020'; 22183f84feSrillig 23*2b097c75Srillig char char_hex4bit = '\xf'; 24*2b097c75Srillig char char_hex7bit = '\x7f'; 25*2b097c75Srillig char char_hex8bit = '\xff'; 26183f84feSrillig /* expect+1: warning: overflow in hex escape [75] */ 27*2b097c75Srillig char char_hex9bit = '\x100'; 28183f84feSrillig /* expect+1: warning: overflow in hex escape [75] */ 29*2b097c75Srillig char char_hex16bit = '\xffff'; 30183f84feSrillig /* expect+1: warning: overflow in hex escape [75] */ 31*2b097c75Srillig char char_hex20bit = '\xfffff'; 32183f84feSrillig /* expect+1: warning: overflow in hex escape [75] */ 33*2b097c75Srillig char char_hex31bit = '\x7fffffff'; 34*2b097c75Srillig /* expect+1: warning: overflow in hex escape [75] */ 35*2b097c75Srillig char char_hex32bit = '\xffffffff'; 36*2b097c75Srillig /* expect+1: warning: overflow in hex escape [75] */ 37*2b097c75Srillig char char_hex33bit = '\x1000000ff'; 38*2b097c75Srillig /* expect+1: warning: overflow in hex escape [75] */ 39*2b097c75Srillig char char_hex36bit = '\xfffffffff'; 40183f84feSrillig 41*2b097c75Srillig int wide_hex4bit = L'\xf'; 42*2b097c75Srillig int wide_hex7bit = L'\x7f'; 43*2b097c75Srillig int wide_hex8bit = L'\xff'; 44*2b097c75Srillig int wide_hex9bit = L'\x100'; 45*2b097c75Srillig int wide_hex16bit = L'\xffff'; 46*2b097c75Srillig int wide_hex20bit = L'\xfffff'; 47*2b097c75Srillig int wide_hex31bit = L'\x7fffffff'; 48*2b097c75Srillig int wide_hex32bit = L'\xffffffff'; 4929354841Srillig /* expect+1: warning: overflow in hex escape [75] */ 50*2b097c75Srillig int wide_hex33bit = L'\x1000000ff'; 51*2b097c75Srillig /* expect+1: warning: overflow in hex escape [75] */ 52*2b097c75Srillig int wide_hex36bit = L'\xfffffffff'; 53183f84feSrillig 54*2b097c75Srillig char char_string_hex4bit[] = "\xf"; 55*2b097c75Srillig char char_string_hex7bit[] = "\x7f"; 56*2b097c75Srillig char char_string_hex8bit[] = "\xff"; 57183f84feSrillig /* expect+1: warning: overflow in hex escape [75] */ 58*2b097c75Srillig char char_string_hex9bit[] = "\x100"; 59183f84feSrillig /* expect+1: warning: overflow in hex escape [75] */ 60*2b097c75Srillig char char_string_hex16bit[] = "\xffff"; 61183f84feSrillig /* expect+1: warning: overflow in hex escape [75] */ 62*2b097c75Srillig char char_string_hex20bit[] = "\xfffff"; 63183f84feSrillig /* expect+1: warning: overflow in hex escape [75] */ 64*2b097c75Srillig char char_string_hex31bit[] = "\x7fffffff"; 65*2b097c75Srillig /* expect+1: warning: overflow in hex escape [75] */ 66*2b097c75Srillig char char_string_hex32bit[] = "\xffffffff"; 67*2b097c75Srillig /* expect+1: warning: overflow in hex escape [75] */ 68*2b097c75Srillig char char_string_hex33bit[] = "\x1000000ff"; 69*2b097c75Srillig /* expect+1: warning: overflow in hex escape [75] */ 70*2b097c75Srillig char char_string_hex36[] = "\xfffffffff"; 71183f84feSrillig 72*2b097c75Srillig int wide_string_hex4bit[] = L"\xf"; 73*2b097c75Srillig int wide_string_hex7bit[] = L"\x7f"; 74*2b097c75Srillig int wide_string_hex8bit[] = L"\xff"; 75*2b097c75Srillig int wide_string_hex9bit[] = L"\x100"; 76*2b097c75Srillig int wide_string_hex16bit[] = L"\xffff"; 77*2b097c75Srillig int wide_string_hex20bit[] = L"\xfffff"; 78*2b097c75Srillig int wide_string_hex31bit[] = L"\x7fffffff"; 79*2b097c75Srillig int wide_string_hex32bit[] = L"\xffffffff"; 80183f84feSrillig /* expect+1: warning: overflow in hex escape [75] */ 81*2b097c75Srillig int wide_string_hex33bit[] = L"\x1000000ff"; 82*2b097c75Srillig /* expect+1: warning: overflow in hex escape [75] */ 83*2b097c75Srillig int wide_string_hex36bit[] = L"\xfffffffff"; 84