Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: add cross-references t...



details:   https://anonhg.NetBSD.org/src/rev/f9a4b89fe026
branches:  trunk
changeset: 985604:f9a4b89fe026
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Aug 31 19:26:23 2021 +0000

description:
tests/lint: add cross-references to message 297

The check for lossy integer conversions is already implemented, it's
just not activated in the default NetBSD build.

diffstat:

 tests/usr.bin/xlint/lint1/msg_259.c         |   7 +++-
 tests/usr.bin/xlint/lint1/msg_259.exp       |  48 ++++++++++++++--------------
 tests/usr.bin/xlint/lint1/msg_259_c90.c     |   7 +++-
 tests/usr.bin/xlint/lint1/msg_259_c90.exp   |  20 ++++++------
 tests/usr.bin/xlint/lint1/msg_259_ilp32.c   |   7 +++-
 tests/usr.bin/xlint/lint1/msg_259_ilp32.exp |   6 +-
 6 files changed, 55 insertions(+), 40 deletions(-)

diffs (140 lines):

diff -r 6481c864b7f0 -r f9a4b89fe026 tests/usr.bin/xlint/lint1/msg_259.c
--- a/tests/usr.bin/xlint/lint1/msg_259.c       Tue Aug 31 19:17:45 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_259.c       Tue Aug 31 19:26:23 2021 +0000
@@ -1,8 +1,13 @@
-/*     $NetBSD: msg_259.c,v 1.15 2021/08/31 18:59:26 rillig Exp $      */
+/*     $NetBSD: msg_259.c,v 1.16 2021/08/31 19:26:23 rillig Exp $      */
 # 3 "msg_259.c"
 
 // Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259]
 
+/*
+ * See also msg_297, but that requires the flags -a -p -P, which are not
+ * enabled in the default NetBSD build.
+ */
+
 /* lint1-only-if: lp64 */
 /* lint1-extra-flags: -h */
 
diff -r 6481c864b7f0 -r f9a4b89fe026 tests/usr.bin/xlint/lint1/msg_259.exp
--- a/tests/usr.bin/xlint/lint1/msg_259.exp     Tue Aug 31 19:17:45 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_259.exp     Tue Aug 31 19:26:23 2021 +0000
@@ -1,24 +1,24 @@
-msg_259.c(32): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
-msg_259.c(52): warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259]
-msg_259.c(55): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259]
-msg_259.c(58): warning: argument #1 is converted from 'long long' to 'unsigned int' due to prototype [259]
-msg_259.c(67): warning: argument #1 is converted from 'long' to 'unsigned long' due to prototype [259]
-msg_259.c(69): warning: argument #1 is converted from 'long long' to 'unsigned long' due to prototype [259]
-msg_259.c(78): warning: argument #1 is converted from 'long' to 'unsigned long long' due to prototype [259]
-msg_259.c(81): warning: argument #1 is converted from 'long long' to 'unsigned long long' due to prototype [259]
-msg_259.c(88): warning: argument #1 is converted from 'unsigned int' to 'int' due to prototype [259]
-msg_259.c(90): warning: argument #1 is converted from 'unsigned long' to 'int' due to prototype [259]
-msg_259.c(92): warning: argument #1 is converted from 'unsigned long long' to 'int' due to prototype [259]
-msg_259.c(95): warning: argument #1 is converted from 'unsigned long' to 'long' due to prototype [259]
-msg_259.c(97): warning: argument #1 is converted from 'unsigned long long' to 'long' due to prototype [259]
-msg_259.c(100): warning: argument #1 is converted from 'unsigned long' to 'long long' due to prototype [259]
-msg_259.c(102): warning: argument #1 is converted from 'unsigned long long' to 'long long' due to prototype [259]
-msg_259.c(110): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
-msg_259.c(112): warning: argument #1 is converted from 'long long' to 'int' due to prototype [259]
-msg_259.c(116): warning: argument #1 is converted from 'long long' to 'long' due to prototype [259]
-msg_259.c(119): warning: argument #1 is converted from 'long' to 'long long' due to prototype [259]
-msg_259.c(128): warning: argument #1 is converted from 'unsigned long' to 'unsigned int' due to prototype [259]
-msg_259.c(130): warning: argument #1 is converted from 'unsigned long long' to 'unsigned int' due to prototype [259]
-msg_259.c(134): warning: argument #1 is converted from 'unsigned long long' to 'unsigned long' due to prototype [259]
-msg_259.c(137): warning: argument #1 is converted from 'unsigned long' to 'unsigned long long' due to prototype [259]
-msg_259.c(151): warning: argument #1 is converted from 'unsigned long' to 'unsigned int' due to prototype [259]
+msg_259.c(37): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
+msg_259.c(57): warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259]
+msg_259.c(60): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259]
+msg_259.c(63): warning: argument #1 is converted from 'long long' to 'unsigned int' due to prototype [259]
+msg_259.c(72): warning: argument #1 is converted from 'long' to 'unsigned long' due to prototype [259]
+msg_259.c(74): warning: argument #1 is converted from 'long long' to 'unsigned long' due to prototype [259]
+msg_259.c(83): warning: argument #1 is converted from 'long' to 'unsigned long long' due to prototype [259]
+msg_259.c(86): warning: argument #1 is converted from 'long long' to 'unsigned long long' due to prototype [259]
+msg_259.c(93): warning: argument #1 is converted from 'unsigned int' to 'int' due to prototype [259]
+msg_259.c(95): warning: argument #1 is converted from 'unsigned long' to 'int' due to prototype [259]
+msg_259.c(97): warning: argument #1 is converted from 'unsigned long long' to 'int' due to prototype [259]
+msg_259.c(100): warning: argument #1 is converted from 'unsigned long' to 'long' due to prototype [259]
+msg_259.c(102): warning: argument #1 is converted from 'unsigned long long' to 'long' due to prototype [259]
+msg_259.c(105): warning: argument #1 is converted from 'unsigned long' to 'long long' due to prototype [259]
+msg_259.c(107): warning: argument #1 is converted from 'unsigned long long' to 'long long' due to prototype [259]
+msg_259.c(115): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
+msg_259.c(117): warning: argument #1 is converted from 'long long' to 'int' due to prototype [259]
+msg_259.c(121): warning: argument #1 is converted from 'long long' to 'long' due to prototype [259]
+msg_259.c(124): warning: argument #1 is converted from 'long' to 'long long' due to prototype [259]
+msg_259.c(133): warning: argument #1 is converted from 'unsigned long' to 'unsigned int' due to prototype [259]
+msg_259.c(135): warning: argument #1 is converted from 'unsigned long long' to 'unsigned int' due to prototype [259]
+msg_259.c(139): warning: argument #1 is converted from 'unsigned long long' to 'unsigned long' due to prototype [259]
+msg_259.c(142): warning: argument #1 is converted from 'unsigned long' to 'unsigned long long' due to prototype [259]
+msg_259.c(156): warning: argument #1 is converted from 'unsigned long' to 'unsigned int' due to prototype [259]
diff -r 6481c864b7f0 -r f9a4b89fe026 tests/usr.bin/xlint/lint1/msg_259_c90.c
--- a/tests/usr.bin/xlint/lint1/msg_259_c90.c   Tue Aug 31 19:17:45 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_259_c90.c   Tue Aug 31 19:26:23 2021 +0000
@@ -1,8 +1,13 @@
-/*     $NetBSD: msg_259_c90.c,v 1.1 2021/08/31 18:59:26 rillig Exp $   */
+/*     $NetBSD: msg_259_c90.c,v 1.2 2021/08/31 19:26:23 rillig Exp $   */
 # 3 "msg_259_c90.c"
 
 /* Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259] */
 
+/*
+ * See also msg_297, but that requires the flags -a -p -P, which are not
+ * enabled in the default NetBSD build.
+ */
+
 /* lint1-only-if: lp64 */
 /* XXX: The flag '-s' suppresses all warnings.  Why? */
 /* lint1-flags: -h -w */
diff -r 6481c864b7f0 -r f9a4b89fe026 tests/usr.bin/xlint/lint1/msg_259_c90.exp
--- a/tests/usr.bin/xlint/lint1/msg_259_c90.exp Tue Aug 31 19:17:45 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_259_c90.exp Tue Aug 31 19:26:23 2021 +0000
@@ -1,10 +1,10 @@
-msg_259_c90.c(32): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
-msg_259_c90.c(52): warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259]
-msg_259_c90.c(55): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259]
-msg_259_c90.c(64): warning: argument #1 is converted from 'long' to 'unsigned long' due to prototype [259]
-msg_259_c90.c(71): warning: argument #1 is converted from 'unsigned int' to 'int' due to prototype [259]
-msg_259_c90.c(73): warning: argument #1 is converted from 'unsigned long' to 'int' due to prototype [259]
-msg_259_c90.c(76): warning: argument #1 is converted from 'unsigned long' to 'long' due to prototype [259]
-msg_259_c90.c(84): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
-msg_259_c90.c(94): warning: argument #1 is converted from 'unsigned long' to 'unsigned int' due to prototype [259]
-msg_259_c90.c(109): warning: argument #1 is converted from 'unsigned long' to 'unsigned int' due to prototype [259]
+msg_259_c90.c(37): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
+msg_259_c90.c(57): warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259]
+msg_259_c90.c(60): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259]
+msg_259_c90.c(69): warning: argument #1 is converted from 'long' to 'unsigned long' due to prototype [259]
+msg_259_c90.c(76): warning: argument #1 is converted from 'unsigned int' to 'int' due to prototype [259]
+msg_259_c90.c(78): warning: argument #1 is converted from 'unsigned long' to 'int' due to prototype [259]
+msg_259_c90.c(81): warning: argument #1 is converted from 'unsigned long' to 'long' due to prototype [259]
+msg_259_c90.c(89): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
+msg_259_c90.c(99): warning: argument #1 is converted from 'unsigned long' to 'unsigned int' due to prototype [259]
+msg_259_c90.c(114): warning: argument #1 is converted from 'unsigned long' to 'unsigned int' due to prototype [259]
diff -r 6481c864b7f0 -r f9a4b89fe026 tests/usr.bin/xlint/lint1/msg_259_ilp32.c
--- a/tests/usr.bin/xlint/lint1/msg_259_ilp32.c Tue Aug 31 19:17:45 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_259_ilp32.c Tue Aug 31 19:26:23 2021 +0000
@@ -1,8 +1,13 @@
-/*     $NetBSD: msg_259_ilp32.c,v 1.3 2021/08/21 11:50:57 rillig Exp $ */
+/*     $NetBSD: msg_259_ilp32.c,v 1.4 2021/08/31 19:26:23 rillig Exp $ */
 # 3 "msg_259_ilp32.c"
 
 // Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259]
 
+/*
+ * See also msg_297, but that requires the flags -a -p -P, which are not
+ * enabled in the default NetBSD build.
+ */
+
 /* lint1-only-if: ilp32 */
 /* lint1-extra-flags: -h */
 
diff -r 6481c864b7f0 -r f9a4b89fe026 tests/usr.bin/xlint/lint1/msg_259_ilp32.exp
--- a/tests/usr.bin/xlint/lint1/msg_259_ilp32.exp       Tue Aug 31 19:17:45 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_259_ilp32.exp       Tue Aug 31 19:26:23 2021 +0000
@@ -1,3 +1,3 @@
-msg_259_ilp32.c(19): warning: argument #1 is converted from 'char' to 'long' due to prototype [259]
-msg_259_ilp32.c(24): warning: argument #1 is converted from 'int' to 'long' due to prototype [259]
-msg_259_ilp32.c(28): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
+msg_259_ilp32.c(24): warning: argument #1 is converted from 'char' to 'long' due to prototype [259]
+msg_259_ilp32.c(29): warning: argument #1 is converted from 'int' to 'long' due to prototype [259]
+msg_259_ilp32.c(33): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]



Home | Main Index | Thread Index | Old Index