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: replace wrong assumption with cita...



details:   https://anonhg.NetBSD.org/src/rev/0c319a3df1d5
branches:  trunk
changeset: 984359:0c319a3df1d5
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 04 17:28:05 2021 +0000

description:
lint: replace wrong assumption with citation from C99

No functional change.

diffstat:

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

diffs (53 lines):

diff -r 8478a421dc71 -r 0c319a3df1d5 tests/usr.bin/xlint/lint1/msg_101.c
--- a/tests/usr.bin/xlint/lint1/msg_101.c       Sun Jul 04 17:16:09 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_101.c       Sun Jul 04 17:28:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_101.c,v 1.8 2021/07/04 17:16:09 rillig Exp $       */
+/*     $NetBSD: msg_101.c,v 1.9 2021/07/04 17:28:06 rillig Exp $       */
 # 3 "msg_101.c"
 
 // Test for message: type '%s' does not have member '%s' [101]
@@ -31,7 +31,6 @@
        /* 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);
-       /* 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 8478a421dc71 -r 0c319a3df1d5 tests/usr.bin/xlint/lint1/msg_101.exp
--- a/tests/usr.bin/xlint/lint1/msg_101.exp     Sun Jul 04 17:16:09 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_101.exp     Sun Jul 04 17:28:05 2021 +0000
@@ -3,4 +3,4 @@
 msg_101.c(27): error: left operand of '.' must be struct or union, not 'pointer to const struct point' [103]
 msg_101.c(29): error: left operand of '->' must be pointer to struct or union, not 'struct point' [104]
 msg_101.c(33): error: type 'pointer to const struct point' does not have member 'z' [101]
-msg_101.c(36): error: type 'struct point' does not have member 'z' [101]
+msg_101.c(35): error: type 'struct point' does not have member 'z' [101]
diff -r 8478a421dc71 -r 0c319a3df1d5 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Jul 04 17:16:09 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Jul 04 17:28:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.311 2021/07/04 17:16:09 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.312 2021/07/04 17:28:05 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.311 2021/07/04 17:16:09 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.312 2021/07/04 17:28:05 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -728,7 +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 */
+               /* C99 6.3.2.1p2 sentence 2 says to remove the qualifiers. */
                tp->t_const = tp->t_volatile = false;
                tn = new_tnode(LOAD, tp, tn, NULL);
        }



Home | Main Index | Thread Index | Old Index