Module Name:    src
Committed By:   rillig
Date:           Sun Jul  4 17:16:09 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: msg_101.c
        src/usr.bin/xlint/lint1: tree.c

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

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_101.c
cvs rdiff -u -r1.310 -r1.311 src/usr.bin/xlint/lint1/tree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_101.c
diff -u src/tests/usr.bin/xlint/lint1/msg_101.c:1.7 src/tests/usr.bin/xlint/lint1/msg_101.c:1.8
--- src/tests/usr.bin/xlint/lint1/msg_101.c:1.7	Sun Jul  4 17:01:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_101.c	Sun Jul  4 17:16:09 2021
@@ -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 @@ test(const struct point *ptr, const stru
 	/* 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);
 }

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.310 src/usr.bin/xlint/lint1/tree.c:1.311
--- src/usr.bin/xlint/lint1/tree.c:1.310	Sun Jul  4 17:01:58 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Jul  4 17:16:09 2021
@@ -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 @@ cconv(tnode_t *tn)
 	/* 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);
 	}

Reply via email to