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: demonstrate missing wa...



details:   https://anonhg.NetBSD.org/src/rev/58e32fe724a4
branches:  trunk
changeset: 377351:58e32fe724a4
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jul 08 12:42:11 2023 +0000

description:
tests/lint: demonstrate missing warning for converting int128_t

diffstat:

 tests/usr.bin/xlint/lint1/platform_lp64.c |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r 2f4cf76e991a -r 58e32fe724a4 tests/usr.bin/xlint/lint1/platform_lp64.c
--- a/tests/usr.bin/xlint/lint1/platform_lp64.c Sat Jul 08 12:07:21 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/platform_lp64.c Sat Jul 08 12:42:11 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: platform_lp64.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */
+/*     $NetBSD: platform_lp64.c,v 1.6 2023/07/08 12:42:11 rillig Exp $ */
 # 3 "platform_lp64.c"
 
 /*
@@ -13,6 +13,8 @@ int s32;
 unsigned int u32;
 long sl32;
 unsigned long ul32;
+__int128_t s128;
+__uint128_t u128;
 
 void
 convert_between_int_and_long(void)
@@ -33,3 +35,11 @@ convert_unsigned_char_to_size_t(unsigned
        /* no warning, unlike platform_int */
        to_size_t(uc);
 }
+
+void
+convert_128(void)
+{
+       /* TODO: Warn about 128-bit types as well. */
+       s32 = s128;
+       u32 = u128;
+}



Home | Main Index | Thread Index | Old Index