summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcloder <cloder@openbsd.org>2005-11-28 01:04:18 +0000
committercloder <cloder@openbsd.org>2005-11-28 01:04:18 +0000
commitbcd3a962e4616bce04256d6efb877e65199b6d36 (patch)
treedf68460a9daf544254c30d3a57d15008f9211dfb
parentList a few more products and mention which radio individual products use. (diff)
downloadwireguard-openbsd-bcd3a962e4616bce04256d6efb877e65199b6d36.tar.xz
wireguard-openbsd-bcd3a962e4616bce04256d6efb877e65199b6d36.zip
Do not complain about promotion of a constant (e.g. from int literal to
a quad argument) as long as the constant is within the range of the type being promoted to.
-rw-r--r--usr.bin/xlint/lint1/tree.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c
index e0848e86f14..15b983b7543 100644
--- a/usr.bin/xlint/lint1/tree.c
+++ b/usr.bin/xlint/lint1/tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tree.c,v 1.11 2005/11/23 00:12:13 cloder Exp $ */
+/* $OpenBSD: tree.c,v 1.12 2005/11/28 01:04:18 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.11 2005/11/23 00:12:13 cloder Exp $";
+static char rcsid[] = "$OpenBSD: tree.c,v 1.12 2005/11/28 01:04:18 cloder Exp $";
#endif
#include <stdlib.h>
@@ -1684,9 +1684,14 @@ ptconv(int arg, tspec_t nt, tspec_t ot, type_t *tp, tnode_t *tn)
if (isftyp(nt) != isftyp(ot) || psize(nt) != psize(ot)) {
/* representation and/or width change */
- if (styp(nt) != SHORT || !isityp(ot) || psize(ot) > psize(INT))
- /* conversion to '%s' due to prototype, arg #%d */
- warning(259, tyname(tp), arg);
+ if (styp(nt) != SHORT || !isityp(ot) || psize(ot) > psize(INT)) {
+ if (ptn->tn_op == CON) {
+ /* ok. promote() warns if constant out of range */
+ } else {
+ /* conversion to '%s' due to prototype, arg #%d */
+ warning(259, tyname(tp), arg);
+ }
+ }
} else if (hflag) {
/*
* they differ in sign or base type (char, short, int,