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 lint: document that message 108 do...



details:   https://anonhg.NetBSD.org/src/rev/2fed4ca7052f
branches:  trunk
changeset: 959100:2fed4ca7052f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 31 16:00:05 2021 +0000

description:
lint: document that message 108 doesn't abort anymore

diffstat:

 tests/usr.bin/xlint/lint1/msg_114.c   |  13 ++++++++++---
 tests/usr.bin/xlint/lint1/msg_114.exp |   3 ++-
 2 files changed, 12 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 6f6dba190cfb -r 2fed4ca7052f tests/usr.bin/xlint/lint1/msg_114.c
--- a/tests/usr.bin/xlint/lint1/msg_114.c       Sun Jan 31 14:57:28 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_114.c       Sun Jan 31 16:00:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_114.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
+/*     $NetBSD: msg_114.c,v 1.4 2021/01/31 16:00:05 rillig Exp $       */
 # 3 "msg_114.c"
 
 // Test for message: %soperand of '%s' must be lvalue [114]
@@ -7,7 +7,14 @@
 example(int a)                 /* expect: 231 */
 {
        3++;                    /* expect: 114 */
-       // FIXME: lint error: ../common/tyname.c, 190: tspec_name(0)
-       // "string"++;
+
+       /*
+        * Before tree.c 1.137 from 2021-01-09, trying to increment an array
+        * aborted lint with 'common/tyname.c, 190: tspec_name(0)'.
+        *
+        * See msg_108.c for more details.
+        */
+       "string"++;             /* expect: 108 */
+
        (a + a)++;              /* expect: 114 */
 }
diff -r 6f6dba190cfb -r 2fed4ca7052f tests/usr.bin/xlint/lint1/msg_114.exp
--- a/tests/usr.bin/xlint/lint1/msg_114.exp     Sun Jan 31 14:57:28 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_114.exp     Sun Jan 31 16:00:05 2021 +0000
@@ -1,3 +1,4 @@
 msg_114.c(9): operand of 'x++' must be lvalue [114]
-msg_114.c(12): operand of 'x++' must be lvalue [114]
+msg_114.c(17): operand of 'x++' has invalid type (array) [108]
+msg_114.c(19): operand of 'x++' must be lvalue [114]
 msg_114.c(7): warning: argument a unused in function example [231]



Home | Main Index | Thread Index | Old Index