tests/lint: test where exactly lint complains about concatenation

This only applies to traditional C and ensures that the behavior is
preserved when rearranging the C parser to evaluate string concatenation
from left to right.
This commit is contained in:
rillig 2022-02-27 18:57:16 +00:00
parent e970c8c0da
commit 6262bf18d3
2 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: msg_219.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
/* $NetBSD: msg_219.c,v 1.4 2022/02/27 18:57:16 rillig Exp $ */
# 3 "msg_219.c"
@ -10,3 +10,10 @@ char concat1[] = "one";
char concat2[] = "one" "two"; /* expect: 219 */
char concat3[] = "one" "two" "three"; /* expect: 219 */
char concat4[] = "one" "two" "three" "four"; /* expect: 219 */
char concat4lines[] =
"one"
/* expect+1: warning: concatenated strings are illegal in traditional C [219] */
"two"
"three"
"four";

View File

@ -1,3 +1,4 @@
msg_219.c(10): warning: concatenated strings are illegal in traditional C [219]
msg_219.c(11): warning: concatenated strings are illegal in traditional C [219]
msg_219.c(12): warning: concatenated strings are illegal in traditional C [219]
msg_219.c(17): warning: concatenated strings are illegal in traditional C [219]