Module Name: src Committed By: rillig Date: Sat Feb 3 09:36:14 UTC 2024
Modified Files: src/tests/usr.bin/xlint/lint1: msg_076.c Log Message: tests/lint: test octal escapes in character and wide strings To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_076.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/usr.bin/xlint/lint1/msg_076.c diff -u src/tests/usr.bin/xlint/lint1/msg_076.c:1.6 src/tests/usr.bin/xlint/lint1/msg_076.c:1.7 --- src/tests/usr.bin/xlint/lint1/msg_076.c:1.6 Fri Feb 2 19:07:58 2024 +++ src/tests/usr.bin/xlint/lint1/msg_076.c Sat Feb 3 09:36:14 2024 @@ -1,7 +1,10 @@ -/* $NetBSD: msg_076.c,v 1.6 2024/02/02 19:07:58 rillig Exp $ */ +/* $NetBSD: msg_076.c,v 1.7 2024/02/03 09:36:14 rillig Exp $ */ # 3 "msg_076.c" // Test for message: character escape does not fit in character [76] +// +// See also: +// msg_075.c for hex escapes /* lint1-extra-flags: -X 351 */ @@ -21,3 +24,19 @@ int wide_256 = L'\400'; int wide_511 = L'\777'; /* expect+1: error: too many characters in character constant [71] */ int wide_512 = L'\1000'; + +char char_string_255[] = "\377"; +/* expect+1: warning: character escape does not fit in character [76] */ +char char_string_256[] = "\400"; +/* expect+1: warning: character escape does not fit in character [76] */ +char char_string_511[] = "\777"; +char char_string_512[] = "\1000"; + +int wide_string_255[] = L"\377"; +/* FIXME: A wide character can represent 256. */ +/* expect+1: warning: character escape does not fit in character [76] */ +int wide_string_256[] = L"\400"; +/* FIXME: A wide character can represent 511. */ +/* expect+1: warning: character escape does not fit in character [76] */ +int wide_string_511[] = L"\777"; +int wide_string_512[] = L"\1000";