Module Name: src
Committed By: rillig
Date: Thu May 26 10:48:47 UTC 2022
Modified Files:
src/usr.bin/xlint/lint1: tree.c
Log Message:
lint: re-order conditions for lossy conversions
Now that can_represent does more work, put it at the end of the
conditions.
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.444 -r1.445 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.444 src/usr.bin/xlint/lint1/tree.c:1.445
--- src/usr.bin/xlint/lint1/tree.c:1.444 Thu May 26 09:26:00 2022
+++ src/usr.bin/xlint/lint1/tree.c Thu May 26 10:48:47 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.444 2022/05/26 09:26:00 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.445 2022/05/26 10:48:47 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.444 2022/05/26 09:26:00 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.445 2022/05/26 10:48:47 rillig Exp $");
#endif
#include <float.h>
@@ -2404,9 +2404,9 @@ check_integer_conversion(op_t op, int ar
if (aflag > 0 &&
portable_size_in_bits(nt) < portable_size_in_bits(ot) &&
- !can_represent(tp, tn) &&
(ot == LONG || ot == ULONG || ot == QUAD || ot == UQUAD ||
- aflag > 1)) {
+ aflag > 1) &&
+ !can_represent(tp, tn)) {
if (op == FARG) {
/* conversion from '%s' to '%s' may lose ... */
warning(298,