Module Name:    src
Committed By:   christos
Date:           Fri Jun 29 20:18:06 UTC 2018

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

Log Message:
add missing args for 123


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 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/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.84 src/usr.bin/xlint/lint1/tree.c:1.85
--- src/usr.bin/xlint/lint1/tree.c:1.84	Mon Mar  6 16:01:39 2017
+++ src/usr.bin/xlint/lint1/tree.c	Fri Jun 29 16:18:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.84 2017/03/06 21:01:39 christos Exp $	*/
+/*	$NetBSD: tree.c,v 1.85 2018/06/29 20:18:05 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.84 2017/03/06 21:01:39 christos Exp $");
+__RCSID("$NetBSD: tree.c,v 1.85 2018/06/29 20:18:05 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -695,6 +695,7 @@ typeok(op_t op, int arg, tnode_t *ln, tn
 	tspec_t	lt, rt = NOTSPEC, lst = NOTSPEC, rst = NOTSPEC, olt = NOTSPEC,
 	    ort = NOTSPEC;
 	type_t	*ltp, *rtp = NULL, *lstp = NULL, *rstp = NULL;
+	char lbuf[128], rbuf[128];
 	tnode_t	*tn;
 
 	mp = &modtab[op];
@@ -951,8 +952,14 @@ typeok(op_t op, int arg, tnode_t *ln, tn
 	case GE:
 		if ((lt == PTR || rt == PTR) && lt != rt) {
 			if (isityp(lt) || isityp(rt)) {
+				const char *lx = lt == PTR ?
+				    "pointer" : "integer";
+				const char *rx = rt == PTR ?
+				    "pointer" : "integer";
+				tyname(lbuf, sizeof(lbuf), ltp);
+				tyname(rbuf, sizeof(rbuf), rtp);
 				/* illegal comb. of pointer and int., op %s */
-				warning(123, mp->m_name);
+				warning(123, lx, lbuf, rx, rbuf, mp->m_name);
 			} else {
 				incompat(op, lt, rt);
 				return (0);
@@ -993,8 +1000,12 @@ typeok(op_t op, int arg, tnode_t *ln, tn
 		}
 
 		if ((lt == PTR && isityp(rt)) || (isityp(lt) && rt == PTR)) {
+			const char *lx = lt == PTR ?  "pointer" : "integer";
+			const char *rx = rt == PTR ?  "pointer" : "integer";
+			tyname(lbuf, sizeof(lbuf), ltp);
+			tyname(rbuf, sizeof(rbuf), rtp);
 			/* illegal comb. of ptr. and int., op %s */
-			warning(123, mp->m_name);
+			warning(123, lx, lbuf, rx, rbuf, mp->m_name);
 			break;
 		}
 

Reply via email to