Module Name:    src
Committed By:   rillig
Date:           Sun Aug  1 13:49:17 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: expr_binary.c expr_binary.exp
        src/usr.bin/xlint/lint1: tree.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/expr_binary.c \
    src/tests/usr.bin/xlint/lint1/expr_binary.exp
cvs rdiff -u -r1.322 -r1.323 src/usr.bin/xlint/lint1/tree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/xlint/lint1/expr_binary.c
diff -u src/tests/usr.bin/xlint/lint1/expr_binary.c:1.2 src/tests/usr.bin/xlint/lint1/expr_binary.c:1.3
--- src/tests/usr.bin/xlint/lint1/expr_binary.c:1.2	Sun Aug  1 13:45:14 2021
+++ src/tests/usr.bin/xlint/lint1/expr_binary.c	Sun Aug  1 13:49:17 2021
@@ -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 @@ cover_balance(void)
 	/* 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);
 }
Index: src/tests/usr.bin/xlint/lint1/expr_binary.exp
diff -u src/tests/usr.bin/xlint/lint1/expr_binary.exp:1.2 src/tests/usr.bin/xlint/lint1/expr_binary.exp:1.3
--- src/tests/usr.bin/xlint/lint1/expr_binary.exp:1.2	Sun Aug  1 13:45:14 2021
+++ src/tests/usr.bin/xlint/lint1/expr_binary.exp	Sun Aug  1 13:49:17 2021
@@ -7,5 +7,5 @@ expr_binary.c(37): warning: passing 'flo
 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]

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.322 src/usr.bin/xlint/lint1/tree.c:1.323
--- src/usr.bin/xlint/lint1/tree.c:1.322	Sat Jul 31 18:16:42 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Aug  1 13:49:17 2021
@@ -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 @@ balance(op_t op, tnode_t **lnp, tnode_t 
 	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;

Reply via email to