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 add missing args for 123



details:   https://anonhg.NetBSD.org/src/rev/b99c5d5d9850
branches:  trunk
changeset: 323756:b99c5d5d9850
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jun 29 20:18:05 2018 +0000

description:
add missing args for 123

diffstat:

 usr.bin/xlint/lint1/tree.c |  19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diffs (56 lines):

diff -r 20483c4b9f31 -r b99c5d5d9850 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Fri Jun 29 19:34:35 2018 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Fri Jun 29 20:18:05 2018 +0000
@@ -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 @@
        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 @@
        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 @@
                }
 
                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;
                }
 



Home | Main Index | Thread Index | Old Index