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 more test cases fo...
details: https://anonhg.NetBSD.org/src/rev/f1da2350e33f
branches: trunk
changeset: 1023055:f1da2350e33f
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Aug 21 11:58:12 2021 +0000
description:
tests/lint: add more test cases for lossy integer conversion
diffstat:
tests/usr.bin/xlint/lint1/msg_259.c | 17 ++++++++++++++++-
tests/usr.bin/xlint/lint1/msg_259.exp | 1 +
2 files changed, 17 insertions(+), 1 deletions(-)
diffs (37 lines):
diff -r f66505423ae7 -r f1da2350e33f tests/usr.bin/xlint/lint1/msg_259.c
--- a/tests/usr.bin/xlint/lint1/msg_259.c Sat Aug 21 11:55:24 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_259.c Sat Aug 21 11:58:12 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_259.c,v 1.11 2021/08/21 11:50:57 rillig Exp $ */
+/* $NetBSD: msg_259.c,v 1.12 2021/08/21 11:58:12 rillig Exp $ */
# 3 "msg_259.c"
// Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259]
@@ -52,4 +52,19 @@
/* TODO: don't warn here. */
/* expect+1: warning: argument #1 is converted from 'long long' to 'unsigned long long' due to prototype [259] */
farg_unsigned_long_long(ll);
+
+ /*
+ * XXX: Why no warning? Even though 'unsigned long' is 64 bits
+ * wide, it cannot represent negative 32-bit values.
+ */
+ farg_unsigned_long(i);
+
+ /*
+ * XXX: Why no warning? Even though 'unsigned long long' is 64 bits
+ * wide, it cannot represent negative 32-bit values.
+ */
+ farg_unsigned_long_long(i);
+
+ /* expect+1: warning: argument #1 is converted from 'long' to 'unsigned long long' due to prototype [259] */
+ farg_unsigned_long_long(l);
}
diff -r f66505423ae7 -r f1da2350e33f tests/usr.bin/xlint/lint1/msg_259.exp
--- a/tests/usr.bin/xlint/lint1/msg_259.exp Sat Aug 21 11:55:24 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_259.exp Sat Aug 21 11:58:12 2021 +0000
@@ -2,3 +2,4 @@
msg_259.c(46): warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259]
msg_259.c(50): warning: argument #1 is converted from 'long' to 'unsigned long' due to prototype [259]
msg_259.c(54): warning: argument #1 is converted from 'long long' to 'unsigned long long' due to prototype [259]
+msg_259.c(69): warning: argument #1 is converted from 'long' to 'unsigned long long' due to prototype [259]
Home |
Main Index |
Thread Index |
Old Index