diff options
author | Chad Loder <cloder@cvs.openbsd.org> | 2005-11-21 18:28:25 +0000 |
---|---|---|
committer | Chad Loder <cloder@cvs.openbsd.org> | 2005-11-21 18:28:25 +0000 |
commit | 740276ee7768c940ba50a50b54ff0fcf64bd2c96 (patch) | |
tree | fd72dff78207ec62daab344461dc00c42412a834 /usr.bin/xlint/lint1 | |
parent | 3e53c7526c9e93e584fee70a723c8a0bd8800334 (diff) |
Print both "from" and "to" types in type conversion warnings. Idea from
NetBSD. OK deraadt, millert
Diffstat (limited to 'usr.bin/xlint/lint1')
-rw-r--r-- | usr.bin/xlint/lint1/err.c | 12 | ||||
-rw-r--r-- | usr.bin/xlint/lint1/tree.c | 10 |
2 files changed, 11 insertions, 11 deletions
diff --git a/usr.bin/xlint/lint1/err.c b/usr.bin/xlint/lint1/err.c index c4df54e4201..22d93d232db 100644 --- a/usr.bin/xlint/lint1/err.c +++ b/usr.bin/xlint/lint1/err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: err.c,v 1.8 2005/11/20 18:23:58 cloder Exp $ */ +/* $OpenBSD: err.c,v 1.9 2005/11/21 18:28:24 cloder Exp $ */ /* $NetBSD: err.c,v 1.8 1995/10/02 17:37:00 jpo Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: err.c,v 1.8 2005/11/20 18:23:58 cloder Exp $"; +static char rcsid[] = "$OpenBSD: err.c,v 1.9 2005/11/21 18:28:24 cloder Exp $"; #endif /* number of errors found */ @@ -184,8 +184,8 @@ const char *msgs[] = { "operands have incompatible pointer types, op %s", /* 128 */ "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 sign-extend incorrectly", /* 131 */ + "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 */ @@ -350,8 +350,8 @@ const char *msgs[] = { "multi-character character constant", /* 294 */ "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 sign-extend incorrectly, arg #%d", /* 297 */ + "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 --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c index 3a9657a251b..50c8176683c 100644 --- a/usr.bin/xlint/lint1/tree.c +++ b/usr.bin/xlint/lint1/tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tree.c,v 1.9 2005/11/20 17:42:49 deraadt Exp $ */ +/* $OpenBSD: tree.c,v 1.10 2005/11/21 18:28:24 cloder Exp $ */ /* $NetBSD: tree.c,v 1.12 1995/10/02 17:37:57 jpo Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: tree.c,v 1.9 2005/11/20 17:42:49 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: tree.c,v 1.10 2005/11/21 18:28:24 cloder Exp $"; #endif #include <stdlib.h> @@ -1725,12 +1725,12 @@ iiconv(op_t op, int arg, tspec_t nt, tspec_t ot, type_t *tp, tnode_t *tn) if (psize(nt) < psize(ot) && (ot == LONG || ot == ULONG || ot == QUAD || ot == UQUAD || aflag > 1)) { - /* conversion from '%s' may lose accuracy */ + /* conversion from '%s' to '%s' may lose accuracy */ if (aflag) { if (op == FARG) { - warning(298, tyname(tn->tn_type), arg); + warning(298, tyname(tn->tn_type), tyname(tp), arg); } else { - warning(132, tyname(tn->tn_type)); + warning(132, tyname(tn->tn_type), tyname(tp)); } } } |