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 say from what type to what time we are c...



details:   https://anonhg.NetBSD.org/src/rev/8c33aa3b1192
branches:  trunk
changeset: 572402:8c33aa3b1192
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 02 10:40:49 2005 +0000

description:
say from what type to what time we are converting.

diffstat:

 usr.bin/xlint/lint1/err.c  |   8 ++++----
 usr.bin/xlint/lint1/tree.c |  20 +++++++++++++-------
 2 files changed, 17 insertions(+), 11 deletions(-)

diffs (93 lines):

diff -r 81680bd6a0fa -r 8c33aa3b1192 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Sun Jan 02 04:29:36 2005 +0000
+++ b/usr.bin/xlint/lint1/err.c Sun Jan 02 10:40:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: err.c,v 1.28 2004/08/03 12:11:54 yamt Exp $    */
+/*     $NetBSD: err.c,v 1.29 2005/01/02 10:40:49 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.28 2004/08/03 12:11:54 yamt Exp $");
+__RCSID("$NetBSD: err.c,v 1.29 2005/01/02 10:40:49 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -191,7 +191,7 @@
        "expression has null effect",                                 /* 129 */
        "enum type mismatch, op %s",                                  /* 130 */
        "conversion to '%s' may sign-extend incorrectly",             /* 131 */
-       "conversion from '%s' may lose accuracy",                     /* 132 */
+       "conversion from '%s' to '%s' may lose accuracy",             /* 132 */
        "conversion of pointer to '%s' loses bits",                   /* 133 */
        "conversion of pointer to '%s' may lose bits",                /* 134 */
        "possible pointer alignment problem",                         /* 135 */
@@ -357,7 +357,7 @@
        "conversion of '%s' to '%s' is out of range, arg #%d",        /* 295 */
        "conversion of negative constant to unsigned type, arg #%d",  /* 296 */
        "conversion to '%s' may sign-extend incorrectly, arg #%d",    /* 297 */
-       "conversion from '%s' may lose accuracy, arg #%d",            /* 298 */
+       "conversion from '%s' to '%s' may lose accuracy, arg #%d",    /* 298 */
        "prototype does not match old style definition, arg #%d",     /* 299 */
        "old style definition",                                       /* 300 */
        "array of incomplete type",                                   /* 301 */
diff -r 81680bd6a0fa -r 8c33aa3b1192 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Jan 02 04:29:36 2005 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Jan 02 10:40:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.38 2004/09/12 08:58:52 yamt Exp $   */
+/*     $NetBSD: tree.c,v 1.39 2005/01/02 10:40:49 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.38 2004/09/12 08:58:52 yamt Exp $");
+__RCSID("$NetBSD: tree.c,v 1.39 2005/01/02 10:40:49 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -1774,7 +1774,7 @@
 static void
 iiconv(op_t op, int arg, tspec_t nt, tspec_t ot, type_t *tp, tnode_t *tn)
 {
-       char buf[64];
+       char lbuf[64], rbuf[64];
        if (tn->tn_op == CON)
                return;
 
@@ -1786,9 +1786,10 @@
                /* conversion to %s may sign-extend incorrectly (, arg #%d) */
                if (aflag && pflag) {
                        if (op == FARG) {
-                               warning(297, tyname(buf, sizeof(buf), tp), arg);
+                               warning(297, tyname(lbuf, sizeof(lbuf), tp),
+                                   arg);
                        } else {
-                               warning(131, tyname(buf, sizeof(buf), tp));
+                               warning(131, tyname(lbuf, sizeof(lbuf), tp));
                        }
                }
        }
@@ -1800,9 +1801,14 @@
                /* conversion from '%s' may lose accuracy */
                if (aflag) {
                        if (op == FARG) {
-                               warning(298, tyname(buf, sizeof(buf), tn->tn_type), arg);
+                               warning(298,
+                                   tyname(rbuf, sizeof(rbuf), tn->tn_type),
+                                   tyname(lbuf, sizeof(lbuf), tp),
+                                   arg);
                        } else {
-                               warning(132, tyname(buf, sizeof(buf), tn->tn_type));
+                               warning(132,
+                                   tyname(rbuf, sizeof(rbuf), tn->tn_type),
+                                   tyname(lbuf, sizeof(lbuf), tp));
                        }
                }
        }



Home | Main Index | Thread Index | Old Index