Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/lint1 lint: fix usual arithmetic conversions f...



details:   https://anonhg.NetBSD.org/src/rev/78e1d0d9ad05
branches:  trunk
changeset: 984943:78e1d0d9ad05
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Aug 01 13:49:17 2021 +0000

description:
lint: fix usual arithmetic conversions for 128-bit integer types

diffstat:

 tests/usr.bin/xlint/lint1/expr_binary.c   |   6 +++---
 tests/usr.bin/xlint/lint1/expr_binary.exp |   4 ++--
 usr.bin/xlint/lint1/tree.c                |  12 +++++++++---
 3 files changed, 14 insertions(+), 8 deletions(-)

diffs (65 lines):

diff -r e42e2c714de7 -r 78e1d0d9ad05 tests/usr.bin/xlint/lint1/expr_binary.c
--- a/tests/usr.bin/xlint/lint1/expr_binary.c   Sun Aug 01 13:45:14 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/expr_binary.c   Sun Aug 01 13:49:17 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: expr_binary.c,v 1.2 2021/08/01 13:45:14 rillig Exp $   */
+/*     $NetBSD: expr_binary.c,v 1.3 2021/08/01 13:49:17 rillig Exp $   */
 # 3 "expr_binary.c"
 
 /*
@@ -45,9 +45,9 @@
        /* expect+1: '__int128_t' */
        sink((__int128_t)1 + 1);
 
-       /* expect+1: 'unsigned int' *//* FIXME */
+       /* expect+1: '__uint128_t' */
        sink((__uint128_t)1 + (__int128_t)1);
 
-       /* expect+1: 'unsigned int' *//* FIXME */
+       /* expect+1: '__uint128_t' */
        sink((__int128_t)1 + (__uint128_t)1);
 }
diff -r e42e2c714de7 -r 78e1d0d9ad05 tests/usr.bin/xlint/lint1/expr_binary.exp
--- a/tests/usr.bin/xlint/lint1/expr_binary.exp Sun Aug 01 13:45:14 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/expr_binary.exp Sun Aug 01 13:49:17 2021 +0000
@@ -7,5 +7,5 @@
 expr_binary.c(40): warning: passing 'float' to incompatible 'struct incompatible', arg #1 [155]
 expr_binary.c(43): warning: passing '__uint128_t' to incompatible 'struct incompatible', arg #1 [155]
 expr_binary.c(46): warning: passing '__int128_t' to incompatible 'struct incompatible', arg #1 [155]
-expr_binary.c(49): warning: passing 'unsigned int' to incompatible 'struct incompatible', arg #1 [155]
-expr_binary.c(52): warning: passing 'unsigned int' to incompatible 'struct incompatible', arg #1 [155]
+expr_binary.c(49): warning: passing '__uint128_t' to incompatible 'struct incompatible', arg #1 [155]
+expr_binary.c(52): warning: passing '__uint128_t' to incompatible 'struct incompatible', arg #1 [155]
diff -r e42e2c714de7 -r 78e1d0d9ad05 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Aug 01 13:45:14 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Aug 01 13:49:17 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.322 2021/07/31 18:16:42 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.323 2021/08/01 13:49:17 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.322 2021/07/31 18:16:42 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.323 2021/08/01 13:49:17 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -1760,7 +1760,13 @@
        bool    u;
        type_t  *ntp;
        static const tspec_t tl[] = {
-               LDOUBLE, DOUBLE, FLOAT, UQUAD, QUAD, ULONG, LONG, UINT, INT,
+               LDOUBLE, DOUBLE, FLOAT,
+#ifdef INT128_SIZE
+               UINT128, INT128,
+#endif
+               UQUAD, QUAD,
+               ULONG, LONG,
+               UINT, INT,
        };
 
        lt = (*lnp)->tn_type->t_tspec;



Home | Main Index | Thread Index | Old Index