summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/usr.bin/xlint/lint1/msg_247_portable.c3
-rw-r--r--tests/usr.bin/xlint/lint1/platform_ilp32_long.c16
2 files changed, 11 insertions, 8 deletions
diff --git a/tests/usr.bin/xlint/lint1/msg_247_portable.c b/tests/usr.bin/xlint/lint1/msg_247_portable.c
index 29025f56fc3..028a41b5131 100644
--- a/tests/usr.bin/xlint/lint1/msg_247_portable.c
+++ b/tests/usr.bin/xlint/lint1/msg_247_portable.c
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_247_portable.c,v 1.2 2023/07/05 11:42:14 rillig Exp $ */
+/* $NetBSD: msg_247_portable.c,v 1.3 2023/07/08 15:26:25 rillig Exp $ */
# 3 "msg_247_portable.c"
// Test for message: pointer cast from '%s' to '%s' may be troublesome [247]
@@ -11,6 +11,7 @@
// msg_247_ilp32_ldbl64.c
// msg_247_lp64_ldbl128.c
+/* lint1-only-if: long */
/* lint1-extra-flags: -c -p -X 351 */
typedef double double_array[5];
diff --git a/tests/usr.bin/xlint/lint1/platform_ilp32_long.c b/tests/usr.bin/xlint/lint1/platform_ilp32_long.c
index 5a1fb977719..c2c46d9f5fe 100644
--- a/tests/usr.bin/xlint/lint1/platform_ilp32_long.c
+++ b/tests/usr.bin/xlint/lint1/platform_ilp32_long.c
@@ -1,4 +1,4 @@
-/* $NetBSD: platform_ilp32_long.c,v 1.3 2023/07/03 21:36:16 rillig Exp $ */
+/* $NetBSD: platform_ilp32_long.c,v 1.4 2023/07/08 15:26:25 rillig Exp $ */
# 3 "platform_ilp32_long.c"
/*
@@ -22,15 +22,17 @@ void
convert_between_int_and_long(void)
{
/*
- * Even though 'long' and 'int' have the same size on this platform,
- * the option '-p' enables additional portability checks that assume
- * a 24-bit int and a 32-bit long type, to proactively detect loss of
- * accuracy on potential other platforms.
+ * The '-p' option enables checks that apply independently of the
+ * current platform, assuming that 'long' is always wider than 'int'.
+ * This assumption, when applied on its own, leads to wrong warnings
+ * that a 32-bit 'long' may lose accuracy when converted to a 32-bit
+ * 'int'.
+ *
+ * To avoid these, take a look at the actually possible values of the
+ * right-hand side, and if they fit in the left-hand side, don't warn.
*/
- /* expect+1: warning: conversion from 'long' to 'int' may lose accuracy [132] */
s32 = sl32;
sl32 = s32;
- /* expect+1: warning: conversion from 'unsigned long' to 'unsigned int' may lose accuracy [132] */
u32 = ul32;
ul32 = u32;
}
line.wiz 2003-02-17Make it play RMID files as well. From bin/20388, Quentin Garnier.augustss 2002-09-30New sentence, new line.grant 2002-06-11err/errx/warn/warnx do not need \n at the enditojun 2002-01-05Sort sections. Use .Ev for environment variables.wiz 2002-01-05Take the default output unit from env MIDIUNIT.augustss 2001-12-01Whitespace cleanup.wiz 2001-11-25Don't open sequencer device if we're not going to play.augustss 2001-10-30Make -p select the right program. Fixes PR 14402, from itohy@netbsd.org.augustss 2001-04-07fix a simple, but important bug for system exclusive messages.tshiozak 2001-02-19convert to use getprogname()cgd 2000-08-12Cosmetic changes.augustss 2000-02-18Add a -p flag to set the MIDI program. From lindroos@nls.fi.augustss 1999-10-11Fix timer reset bug when playing multiple songs.augustss 1999-09-30Typo.soren 1999-09-12Use full month names with .Dd, as per mdoc.samples(7).kleink 1999-03-10Add missing .El line.erh 1998-11-25Make the copyright header conform to the NetBSD template.augustss 1998-10-20Add f flag to getopt() argument. Fixes PR 6335.augustss 1998-08-13Handle SYSEX events.augustss 1998-08-13Improve man page.augustss 1998-08-13Handle MIDI files with running status correctly.augustss 1998-08-13Fix type that prevented program and controller changes.augustss 1998-08-12Make user tempo setting more sane.augustss 1998-08-12Add a very simple MIDI player. No features, no fluff.augustss