Module Name:    src
Committed By:   christos
Date:           Wed Jul 29 18:22:06 UTC 2015

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

Log Message:
Be more specific about the type errors


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.78 -r1.79 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/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.47 src/usr.bin/xlint/lint1/err.c:1.48
--- src/usr.bin/xlint/lint1/err.c:1.47	Tue Feb 18 17:01:36 2014
+++ src/usr.bin/xlint/lint1/err.c	Wed Jul 29 14:22:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.47 2014/02/18 22:01:36 christos Exp $	*/
+/*	$NetBSD: err.c,v 1.48 2015/07/29 18:22:06 christos Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.47 2014/02/18 22:01:36 christos Exp $");
+__RCSID("$NetBSD: err.c,v 1.48 2015/07/29 18:22:06 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -163,7 +163,7 @@ const	char *msgs[] = {
 	"undefined struct/union member: %s",			      /* 101 */
 	"illegal member use: %s",				      /* 102 */
 	"left operand of '.' must be struct/union object",	      /* 103 */
-	"left operand of '->' must be pointer to struct/union",	      /* 104 */
+	"left operand of '->' must be pointer to struct/union and is %s",	/* 104 */
 	"non-unique member requires struct/union %s",		      /* 105 */
 	"left operand of '->' must be pointer",			      /* 106 */
 	"operands of '%s' have incompatible types (%s != %s)",		      /* 107 */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.78 src/usr.bin/xlint/lint1/tree.c:1.79
--- src/usr.bin/xlint/lint1/tree.c:1.78	Mon Feb  9 13:17:34 2015
+++ src/usr.bin/xlint/lint1/tree.c	Wed Jul 29 14:22:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.78 2015/02/09 18:17:34 christos Exp $	*/
+/*	$NetBSD: tree.c,v 1.79 2015/07/29 18:22:06 christos 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.78 2015/02/09 18:17:34 christos Exp $");
+__RCSID("$NetBSD: tree.c,v 1.79 2015/07/29 18:22:06 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -431,11 +431,14 @@ strmemb(tnode_t *tn, op_t op, sym_t *msy
 				error(103);
 			}
 		} else {
+			char buf[64];
 			/* left operand of "->" must be pointer to ... */
 			if (tflag && tn->tn_type->t_tspec == PTR) {
-				warning(104);
+				tyname(buf, sizeof(buf), tn->tn_type);
+				warning(104, buf);
 			} else {
-				error(104);
+				tyname(buf, sizeof(buf), tn->tn_type);
+				error(104, buf);
 			}
 		}
 	} else {

Reply via email to