xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_254.c (revision 183f84fe872ccaa5d671b1ae9610c95e0e166fae)
1 /*	$NetBSD: msg_254.c,v 1.6 2024/02/02 19:07:58 rillig Exp $	*/
2 # 3 "msg_254.c"
3 
4 /* Test for message: newline in string or char constant [254] */
5 
6 /* lint1-flags: -tw -q17 */
7 
8 /*
9  * A literal newline must not occur in a character constant or string literal.
10  */
11 
12 /* expect+3: error: newline in string or char constant [254] */
13 /* expect+2: error: unterminated character constant [253] */
14 char char_incomplete = 'x
15 ;
16 /* expect+3: error: newline in string or char constant [254] */
17 /* expect+2: error: unterminated string constant [258] */
18 char char_string_incomplete[] = "x
19 ;
20 /* expect+3: error: newline in string or char constant [254] */
21 /* expect+2: error: unterminated character constant [253] */
22 int wide_incomplete = L'x
23 ;
24 /* expect+3: error: newline in string or char constant [254] */
25 /* expect+2: error: unterminated string constant [258] */
26 int wide_string_incomplete[] = L"x
27 ;
28