Module Name:    src
Committed By:   rillig
Date:           Mon Jan  8 17:11:32 UTC 2024

Modified Files:
        src/tests/usr.bin/xlint/lint1: msg_141.c

Log Message:
tests/lint: fix overflow test for 32-bit platforms (since yesterday)

Plain integer constants without suffix are first tried to fit into
'int', then 'long', but not 'long long'.  This means that numbers larger
than 32 bits must be written with the LL suffix.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/msg_141.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/msg_141.c
diff -u src/tests/usr.bin/xlint/lint1/msg_141.c:1.8 src/tests/usr.bin/xlint/lint1/msg_141.c:1.9
--- src/tests/usr.bin/xlint/lint1/msg_141.c:1.8	Sun Jan  7 21:19:42 2024
+++ src/tests/usr.bin/xlint/lint1/msg_141.c	Mon Jan  8 17:11:32 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_141.c,v 1.8 2024/01/07 21:19:42 rillig Exp $	*/
+/*	$NetBSD: msg_141.c,v 1.9 2024/01/08 17:11:32 rillig Exp $	*/
 # 3 "msg_141.c"
 
 // Test for message: operator '%s' produces integer overflow [141]
@@ -68,7 +68,7 @@ unsigned long long overflow_unsigned[] =
 	0x10000U * 0x10000U,
 	0x10000ULL * 0x10000U,
 	/* expect+1: warning: operator '*' produces integer overflow [141] */
-	0x100000000U * 0x100000000U,
+	0x100000000ULL * 0x100000000ULL,
 
 	// '/'
 
@@ -123,12 +123,12 @@ long long overflow_signed[] = {
 	// unary '+'
 
 	+(unsigned char)255,
-	+0x7fffffffffffffff,
+	+0x7fffffffffffffffLL,
 
 	// unary '-'
 
 	-(unsigned char)255,
-	-0x7fffffffffffffff,
+	-0x7fffffffffffffffLL,
 
 	// '~'
 

Reply via email to