Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/lint1 lint: document where to fix missing cons...



details:   https://anonhg.NetBSD.org/src/rev/8478a421dc71
branches:  trunk
changeset: 984358:8478a421dc71
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 04 17:16:09 2021 +0000

description:
lint: document where to fix missing const in lvalue-to-rvalue

No functional change.

diffstat:

 tests/usr.bin/xlint/lint1/msg_101.c |  4 ++--
 usr.bin/xlint/lint1/tree.c          |  5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r 314b0839be7d -r 8478a421dc71 tests/usr.bin/xlint/lint1/msg_101.c
--- a/tests/usr.bin/xlint/lint1/msg_101.c       Sun Jul 04 17:01:58 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_101.c       Sun Jul 04 17:16:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_101.c,v 1.7 2021/07/04 17:01:58 rillig Exp $       */
+/*     $NetBSD: msg_101.c,v 1.8 2021/07/04 17:16:09 rillig Exp $       */
 # 3 "msg_101.c"
 
 // Test for message: type '%s' does not have member '%s' [101]
@@ -31,7 +31,7 @@
        /* accessing a nonexistent member via the wrong operator */
        /* expect+1: error: type 'pointer to const struct point' does not have member 'z' [101] */
        sink(ptr.z);
-       /* XXX: Why is the 'const' missing here, but not above? */
+       /* FIXME: In cconv, don't set t_const unconditionally to false. */
        /* expect+1: error: type 'struct point' does not have member 'z' [101] */
        sink(pt->z);
 }
diff -r 314b0839be7d -r 8478a421dc71 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Jul 04 17:01:58 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Jul 04 17:16:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.310 2021/07/04 17:01:58 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.311 2021/07/04 17:16:09 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.310 2021/07/04 17:01:58 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.311 2021/07/04 17:16:09 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -728,6 +728,7 @@
        /* lvalue to rvalue */
        if (tn->tn_lvalue) {
                tp = expr_dup_type(tn->tn_type);
+               /* FIXME: even rvalues can be const/volatile, see msg_101 */
                tp->t_const = tp->t_volatile = false;
                tn = new_tnode(LOAD, tp, tn, NULL);
        }



Home | Main Index | Thread Index | Old Index