Sun Feb 27 18:57:16 2022 UTC ()
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.


(rillig)
diff -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_219.c
diff -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_219.exp

cvs diff -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_219.c (expand / switch to unified diff)

--- src/tests/usr.bin/xlint/lint1/msg_219.c 2021/01/31 11:12:07 1.3
+++ src/tests/usr.bin/xlint/lint1/msg_219.c 2022/02/27 18:57:16 1.4
@@ -1,12 +1,19 @@ @@ -1,12 +1,19 @@
1/* $NetBSD: msg_219.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */ 1/* $NetBSD: msg_219.c,v 1.4 2022/02/27 18:57:16 rillig Exp $ */
2# 3 "msg_219.c" 2# 3 "msg_219.c"
3 3
4 4
5/* Test for message: concatenated strings are illegal in traditional C [219] */ 5/* Test for message: concatenated strings are illegal in traditional C [219] */
6 6
7/* lint1-flags: -t -w */ 7/* lint1-flags: -t -w */
8 8
9char concat1[] = "one"; 9char concat1[] = "one";
10char concat2[] = "one" "two"; /* expect: 219 */ 10char concat2[] = "one" "two"; /* expect: 219 */
11char concat3[] = "one" "two" "three"; /* expect: 219 */ 11char concat3[] = "one" "two" "three"; /* expect: 219 */
12char concat4[] = "one" "two" "three" "four"; /* expect: 219 */ 12char concat4[] = "one" "two" "three" "four"; /* expect: 219 */
 13
 14char concat4lines[] =
 15 "one"
 16 /* expect+1: warning: concatenated strings are illegal in traditional C [219] */
 17 "two"
 18 "three"
 19 "four";

cvs diff -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/Attic/msg_219.exp (expand / switch to unified diff)

--- src/tests/usr.bin/xlint/lint1/Attic/msg_219.exp 2021/03/28 15:36:37 1.3
+++ src/tests/usr.bin/xlint/lint1/Attic/msg_219.exp 2022/02/27 18:57:16 1.4
@@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@
1msg_219.c(10): warning: concatenated strings are illegal in traditional C [219] 1msg_219.c(10): warning: concatenated strings are illegal in traditional C [219]
2msg_219.c(11): warning: concatenated strings are illegal in traditional C [219] 2msg_219.c(11): warning: concatenated strings are illegal in traditional C [219]
3msg_219.c(12): warning: concatenated strings are illegal in traditional C [219] 3msg_219.c(12): warning: concatenated strings are illegal in traditional C [219]
 4msg_219.c(17): warning: concatenated strings are illegal in traditional C [219]