Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: test where exactly lin...



details:   https://anonhg.NetBSD.org/src/rev/322ad8f313b3
branches:  trunk
changeset: 362451:322ad8f313b3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Feb 27 18:57:16 2022 +0000

description:
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.

diffstat:

 tests/usr.bin/xlint/lint1/msg_219.c   |  9 ++++++++-
 tests/usr.bin/xlint/lint1/msg_219.exp |  1 +
 2 files changed, 9 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r 3230bc8ecc20 -r 322ad8f313b3 tests/usr.bin/xlint/lint1/msg_219.c
--- a/tests/usr.bin/xlint/lint1/msg_219.c       Sun Feb 27 18:51:21 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_219.c       Sun Feb 27 18:57:16 2022 +0000
@@ -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 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";
diff -r 3230bc8ecc20 -r 322ad8f313b3 tests/usr.bin/xlint/lint1/msg_219.exp
--- a/tests/usr.bin/xlint/lint1/msg_219.exp     Sun Feb 27 18:51:21 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_219.exp     Sun Feb 27 18:57:16 2022 +0000
@@ -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]



Home | Main Index | Thread Index | Old Index