CVS commit: src/tests/usr.bin/xlint/lint1

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 28 06:57:41 UTC 2024

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

Log Message:
tests/lint: fix tests for integer constants on ILP32 platforms

The comment in msg_218 was both off-topic and wrong, so remove it.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/msg_218.c

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



CVS commit: src/tests/usr.bin/xlint/lint1

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 28 06:57:41 UTC 2024

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

Log Message:
tests/lint: fix tests for integer constants on ILP32 platforms

The comment in msg_218 was both off-topic and wrong, so remove it.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/msg_218.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/lex_integer_ilp32.c
diff -u src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c:1.8 src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c:1.9
--- src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c:1.8	Tue Mar 28 14:44:34 2023
+++ src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c	Sun Jan 28 06:57:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: lex_integer_ilp32.c,v 1.8 2023/03/28 14:44:34 rillig Exp $	*/
+/*	$NetBSD: lex_integer_ilp32.c,v 1.9 2024/01/28 06:57:41 rillig Exp $	*/
 # 3 "lex_integer_ilp32.c"
 
 /*
@@ -23,12 +23,11 @@ test_signed_int(void)
 
 	sinki(2147483647);
 
-	/* expect+1: warning: conversion of 'unsigned long' to 'int' is out of range, arg #1 [295] */
+	/* expect+1: warning: conversion of 'long long' to 'int' is out of range, arg #1 [295] */
 	sinki(2147483648);
 
 	sinki(-2147483647);
 
-	/* expect+1: warning: conversion of 'unsigned long' to 'int' is out of range, arg #1 [295] */
 	sinki(-2147483648);
 }
 
@@ -43,6 +42,6 @@ test_unsigned_int(void)
 	sinku(2147483648U);
 	sinku(4294967295U);
 
-	/* expect+1: warning: integer constant out of range [252] */
+	/* expect+1: warning: conversion of 'unsigned long long' to 'unsigned int' is out of range, arg #1 [295] */
 	sinku(4294967296U);
 }

Index: src/tests/usr.bin/xlint/lint1/msg_218.c
diff -u src/tests/usr.bin/xlint/lint1/msg_218.c:1.9 src/tests/usr.bin/xlint/lint1/msg_218.c:1.10
--- src/tests/usr.bin/xlint/lint1/msg_218.c:1.9	Sat Aug 26 10:43:53 2023
+++ src/tests/usr.bin/xlint/lint1/msg_218.c	Sun Jan 28 06:57:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_218.c,v 1.9 2023/08/26 10:43:53 rillig Exp $	*/
+/*	$NetBSD: msg_218.c,v 1.10 2024/01/28 06:57:41 rillig Exp $	*/
 # 3 "msg_218.c"
 
 /* Test for message: C90 treats constant as unsigned, op '%s' [218] */
@@ -20,40 +20,41 @@ void sink_int(int);
 void
 test_signed_int(void)
 {
+	/* expect+3: warning: integer constant out of range [252] */
 	/* expect+2: warning: C90 treats constant as unsigned, op '-' [218] */
 	/* expect+1: warning: conversion of 'unsigned long' to 'int' is out of range, arg #1 [295] */
 	sink_int(-2147483648);
 }
 
 /*
- * In traditional C, integer constants with an 'L' suffix that didn't fit
- * into 'long' were promoted to the next larger integer type, if that existed
- * at all, as the suffix 'LL' was introduced by C90.
- *
- * Starting with C90, integer constants with an 'L' suffix that didn't fit
- * into 'long' were promoted to 'unsigned long' first, before trying 'long
- * long'.
- *
- * In C99 mode, this distinction is no longer necessary since it is far
- * enough from traditional C.
+ * TODO: Investigate whether the message 218 is actually correct.
+ * See C1978 2.4.1 "Integer constants" and 6.6 "Arithmetic conversions".
  */
 void
 compare_large_constant(void)
 {
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: warning: C90 treats constant as unsigned, op '<' [218] */
 	cond = s32 < 30L;
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: warning: C90 treats constant as unsigned, op '<' [218] */
 	cond = 30L < s32;
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: warning: C90 treats constant as unsigned, op '<' [218] */
 	cond = u32 < 30L;
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: warning: C90 treats constant as unsigned, op '<' [218] */
 	cond = 30L < u32;
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: warning: C90 treats constant as unsigned, op '<' [218] */
 	cond = s64 < 30L;
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: warning: C90 treats constant as unsigned, op '<' [218] */
 	cond = 30L < s64;
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: warning: C90 treats constant as unsigned, op '<' [218] */
 	cond = u64 < 30L;
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: warning: C90 treats constant as unsigned, op '<' [218] */
 	cond = 30L < u64;
 }



CVS commit: src/distrib/sets/lists/xserver

2024-01-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 28 06:20:02 UTC 2024

Modified Files:
src/distrib/sets/lists/xserver: md.alpha md.netwinder md.sgimips md.vax

Log Message:
Also put back libfb.a in xorg_server_ver=110 case.

It looks required only on building Xorg server binary and
unnecessary for release (actually marked as obsolete only on vax),
but no simple settings to "build static libraries without installation"
and most ports will be switched to Xorg 1.20 soon.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/distrib/sets/lists/xserver/md.alpha
cvs rdiff -u -r1.48 -r1.49 src/distrib/sets/lists/xserver/md.netwinder
cvs rdiff -u -r1.70 -r1.71 src/distrib/sets/lists/xserver/md.sgimips
cvs rdiff -u -r1.28 -r1.29 src/distrib/sets/lists/xserver/md.vax

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



CVS commit: src/distrib/sets/lists/xserver

2024-01-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 28 06:20:02 UTC 2024

Modified Files:
src/distrib/sets/lists/xserver: md.alpha md.netwinder md.sgimips md.vax

Log Message:
Also put back libfb.a in xorg_server_ver=110 case.

It looks required only on building Xorg server binary and
unnecessary for release (actually marked as obsolete only on vax),
but no simple settings to "build static libraries without installation"
and most ports will be switched to Xorg 1.20 soon.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/distrib/sets/lists/xserver/md.alpha
cvs rdiff -u -r1.48 -r1.49 src/distrib/sets/lists/xserver/md.netwinder
cvs rdiff -u -r1.70 -r1.71 src/distrib/sets/lists/xserver/md.sgimips
cvs rdiff -u -r1.28 -r1.29 src/distrib/sets/lists/xserver/md.vax

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

Modified files:

Index: src/distrib/sets/lists/xserver/md.alpha
diff -u src/distrib/sets/lists/xserver/md.alpha:1.62 src/distrib/sets/lists/xserver/md.alpha:1.63
--- src/distrib/sets/lists/xserver/md.alpha:1.62	Fri Jan 26 12:58:51 2024
+++ src/distrib/sets/lists/xserver/md.alpha	Sun Jan 28 06:20:02 2024
@@ -1,4 +1,4 @@
-# $NetBSD: md.alpha,v 1.62 2024/01/26 12:58:51 tsutsui Exp $
+# $NetBSD: md.alpha,v 1.63 2024/01/28 06:20:02 tsutsui Exp $
 ./usr/X11R7/bin/X	xserver-xorg-server-bin	xorg
 ./usr/X11R7/bin/Xorg	xserver-xorg-server-bin	xorg
 ./usr/X11R7/bin/gtf	xserver-xorg-server-bin	xorg
@@ -174,7 +174,8 @@
 ./usr/X11R7/lib/modules/libexa.so			xserver-exa-modules	xorg
 ./usr/X11R7/lib/modules/libexa.so.0			xserver-exa-modules	xorg
 ./usr/X11R7/lib/modules/libexa_pic.a			xserver-obsolete	xorg,picinstall,obsolete
-./usr/X11R7/lib/modules/libfb.axserver-obsolete	obsolete
+./usr/X11R7/lib/modules/libfb.a-unknown-	xorg,xorg_server_ver=110
+./usr/X11R7/lib/modules/libfb.axserver-obsolete	xorg,xorg_server_ver=120,obsolete
 ./usr/X11R7/lib/modules/libfb.so			-unknown-	xorg,xorg_server_ver=110
 ./usr/X11R7/lib/modules/libfb.so			xserver-obsolete	xorg,xorg_server_ver=120,obsolete
 ./usr/X11R7/lib/modules/libfb.so.0			-unknown-	xorg,xorg_server_ver=110

Index: src/distrib/sets/lists/xserver/md.netwinder
diff -u src/distrib/sets/lists/xserver/md.netwinder:1.48 src/distrib/sets/lists/xserver/md.netwinder:1.49
--- src/distrib/sets/lists/xserver/md.netwinder:1.48	Fri Jan 26 12:58:51 2024
+++ src/distrib/sets/lists/xserver/md.netwinder	Sun Jan 28 06:20:02 2024
@@ -1,4 +1,4 @@
-# $NetBSD: md.netwinder,v 1.48 2024/01/26 12:58:51 tsutsui Exp $
+# $NetBSD: md.netwinder,v 1.49 2024/01/28 06:20:02 tsutsui Exp $
 ./usr/X11R7/bin/X	xserver-xorg-server-bin	xorg
 ./usr/X11R7/bin/Xorg	xserver-xorg-server-bin	xorg
 ./usr/X11R7/bin/gtf	xserver-xorg-server-bin	xorg
@@ -86,7 +86,8 @@
 ./usr/X11R7/lib/modules/libexa.so			xserver-exa-modules	xorg
 ./usr/X11R7/lib/modules/libexa.so.0			xserver-exa-modules	xorg
 ./usr/X11R7/lib/modules/libexa_pic.a			xserver-obsolete	xorg,picinstall,obsolete
-./usr/X11R7/lib/modules/libfb.axserver-obsolete	obsolete
+./usr/X11R7/lib/modules/libfb.a-unknown-	xorg,xorg_server_ver=110
+./usr/X11R7/lib/modules/libfb.axserver-obsolete	xorg,xorg_server_ver=120,obsolete
 ./usr/X11R7/lib/modules/libfb.so			-unknown-	xorg,xorg_server_ver=110
 ./usr/X11R7/lib/modules/libfb.so			xserver-obsolete	xorg,xorg_server_ver=120,obsolete
 ./usr/X11R7/lib/modules/libfb.so.0			-unknown-	xorg,xorg_server_ver=110

Index: src/distrib/sets/lists/xserver/md.sgimips
diff -u src/distrib/sets/lists/xserver/md.sgimips:1.70 src/distrib/sets/lists/xserver/md.sgimips:1.71
--- src/distrib/sets/lists/xserver/md.sgimips:1.70	Fri Jan 26 12:58:51 2024
+++ src/distrib/sets/lists/xserver/md.sgimips	Sun Jan 28 06:20:02 2024
@@ -1,4 +1,4 @@
-# $NetBSD: md.sgimips,v 1.70 2024/01/26 12:58:51 tsutsui Exp $	x11
+# $NetBSD: md.sgimips,v 1.71 2024/01/28 06:20:02 tsutsui Exp $	x11
 ./usr/X11R7/bin/X	xserver-xorg-server-bin	xorg
 ./usr/X11R7/bin/Xorg	xserver-xorg-server-bin	xorg
 ./usr/X11R7/bin/gtf	xserver-xorg-server-bin	xorg
@@ -102,7 +102,8 @@
 ./usr/X11R7/lib/modules/libexa.so			xserver-exa-modules	xorg
 ./usr/X11R7/lib/modules/libexa.so.0			xserver-exa-modules	xorg
 ./usr/X11R7/lib/modules/libexa_pic.a			xserver-obsolete	xorg,picinstall,obsolete
-./usr/X11R7/lib/modules/libfb.axserver-obsolete	obsolete
+./usr/X11R7/lib/modules/libfb.a-unknown-	xorg,xorg_server_ver=110
+./usr/X11R7/lib/modules/libfb.axserver-obsolete	xorg,xorg_server_ver=120,obsolete
 ./usr/X11R7/lib/modules/libfb.so			-unknown-	xorg,xorg_server_ver=110
 ./usr/X11R7/lib/modules/libfb.so			xserver-obsolete	xorg,xorg_server_ver=120,obsolete
 ./usr/X11R7/lib/modules/libfb.so.0			-unknown-	xorg,xorg_server_ver=110

Index: src/distrib/sets/lists/xserver/md.vax
diff -u src/distrib/sets/lists/xserver/md.vax:1.28 src/distrib/sets/lists/xserver/md.vax:1.29
--- src/distrib/sets/lists/xserver/md.vax:1.28	Fri Jan 26 

re: CVS commit: src

2024-01-27 Thread matthew green
"Taylor R Campbell" writes:
> Mark /var/run/named obsolete in the set lists.  XXX This isn't quite
> right, because it is legitimate for /var/run/named to exist in a
> running installation, but it doesn't exist in a freshly installed
> system any more.  Maybe we should just remove the entry from the set
> lists and add a note to UPDATING about deleting it manually from the
> destdir in incremental builds.

i think removing it is right.  obsolete removes something that
might be in-use, if someone were to run postinstall when named
is running (which isn't _too_ unexpected.)

thanks.


.mrg.


CVS commit: src/tests/lib/libutil

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 21:42:29 UTC 2024

Modified Files:
src/tests/lib/libutil: t_snprintb.c

Log Message:
tests/libutil/snprintb: remove redundant integer constant suffixes

I added these because lint told me so. Lint was wrong though, as it had
not implemented the C99 rules for integer constants.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libutil/t_snprintb.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/lib/libutil/t_snprintb.c
diff -u src/tests/lib/libutil/t_snprintb.c:1.11 src/tests/lib/libutil/t_snprintb.c:1.12
--- src/tests/lib/libutil/t_snprintb.c:1.11	Sat Jan 27 10:32:03 2024
+++ src/tests/lib/libutil/t_snprintb.c	Sat Jan 27 21:42:29 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: t_snprintb.c,v 1.11 2024/01/27 10:32:03 rillig Exp $ */
+/* $NetBSD: t_snprintb.c,v 1.12 2024/01/27 21:42:29 rillig Exp $ */
 
 /*
  * Copyright (c) 2002, 2004, 2008, 2010, 2024 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008, 2010\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_snprintb.c,v 1.11 2024/01/27 10:32:03 rillig Exp $");
+__RCSID("$NetBSD: t_snprintb.c,v 1.12 2024/01/27 21:42:29 rillig Exp $");
 
 #include 
 #include 
@@ -161,7 +161,7 @@ ATF_TC_BODY(snprintb, tc)
 	// The old-style format supports only 32 bits, interpreting the
 	// \041 as part of the text belonging to bit 1.
 	"\04133",
-	0x00ff0f35ULL,
+	0x00ff0f35,
 	"0x00ff0f35<24,6,5,3,1!33>");
 
 	// old-style format, hexadecimal, from lsb to msb
@@ -181,7 +181,7 @@ ATF_TC_BODY(snprintb, tc)
 	// The old-style format supports only 32 bits, interpreting the
 	// \041 as part of the text belonging to bit 32.
 	"\04133",
-	0xff00f0caULL,
+	0xff00f0ca,
 	"0xff00f0ca<2,4,7,8,16,32!33>");
 
 	// The bits can be listed in arbitrary order, there can also be
@@ -208,7 +208,7 @@ ATF_TC_BODY(snprintb, tc)
 	"\020"
 	"\177undefined_behavior"
 	"\001lsb",
-	0xULL,
+	0x,
 	"0x");
 #endif
 
@@ -276,7 +276,7 @@ ATF_TC_BODY(snprintb, tc)
 	"b\037bit31\0"
 	"b\040bit32\0"
 	"b\077bit63\0",
-	0xf00ff00fULL,
+	0xf00ff00f,
 	"01777600017");
 
 	// new-style format, single bits, decimal
@@ -286,7 +286,7 @@ ATF_TC_BODY(snprintb, tc)
 	"b\037bit31\0"
 	"b\040bit32\0"
 	"b\077bit63\0",
-	0xf00ff00fULL,
+	0xf00ff00f,
 	"17293822637553745935");
 
 	// new-style format, single bits, hexadecimal
@@ -296,7 +296,7 @@ ATF_TC_BODY(snprintb, tc)
 	"b\037bit31\0"
 	"b\040bit32\0"
 	"b\077bit63\0",
-	0xf00ff00fULL,
+	0xf00ff00f,
 	"0xf00ff00f");
 
 	// new-style format, invalid number base 2



CVS commit: src/tests/lib/libutil

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 21:42:29 UTC 2024

Modified Files:
src/tests/lib/libutil: t_snprintb.c

Log Message:
tests/libutil/snprintb: remove redundant integer constant suffixes

I added these because lint told me so. Lint was wrong though, as it had
not implemented the C99 rules for integer constants.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libutil/t_snprintb.c

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



CVS commit: src

2024-01-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jan 27 21:06:09 UTC 2024

Modified Files:
src/distrib/sets/lists/base: mi
src/etc/mtree: NetBSD.dist.base

Log Message:
NetBSD.dist.base: Nix /var/run/named.

/var/run is emptied at boot time by /etc/rc.d/mountcritlocal, so
there's no point in creating this at install time -- it has to be
created on the fly after /var/run is cleared on every boot anyway.

Mark /var/run/named obsolete in the set lists.  XXX This isn't quite
right, because it is legitimate for /var/run/named to exist in a
running installation, but it doesn't exist in a freshly installed
system any more.  Maybe we should just remove the entry from the set
lists and add a note to UPDATING about deleting it manually from the
destdir in incremental builds.

PR misc/57877


To generate a diff of this commit:
cvs rdiff -u -r1.1330 -r1.1331 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.254 -r1.255 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1330 src/distrib/sets/lists/base/mi:1.1331
--- src/distrib/sets/lists/base/mi:1.1330	Mon Jan  1 18:56:53 2024
+++ src/distrib/sets/lists/base/mi	Sat Jan 27 21:06:09 2024
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1330 2024/01/01 18:56:53 kim Exp $
+# $NetBSD: mi,v 1.1331 2024/01/27 21:06:09 riastradh Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -6342,7 +6342,7 @@
 ./var/quotas	base-util-root
 ./var/run	base-sys-root
 ./var/run/lwresdbase-obsolete		obsolete
-./var/run/named	base-bind-root
+./var/run/named	base-obsolete		obsolete
 ./var/rwho	base-netutil-root
 ./var/shm	base-sys-root
 ./var/spool	base-sys-root

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.254 src/etc/mtree/NetBSD.dist.base:1.255
--- src/etc/mtree/NetBSD.dist.base:1.254	Sat Jan 27 21:01:08 2024
+++ src/etc/mtree/NetBSD.dist.base	Sat Jan 27 21:06:09 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.254 2024/01/27 21:01:08 riastradh Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.255 2024/01/27 21:06:09 riastradh Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1449,7 +1449,6 @@
 ./var/preserve
 ./var/quotas			gname=operator mode=0750
 ./var/run
-./var/run/named			mode=0775 uname=named gname=named
 ./var/rwho			uname=_rwhod gname=_rwhod
 ./var/shm			mode=01777
 ./var/spool



CVS commit: src

2024-01-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jan 27 21:06:09 UTC 2024

Modified Files:
src/distrib/sets/lists/base: mi
src/etc/mtree: NetBSD.dist.base

Log Message:
NetBSD.dist.base: Nix /var/run/named.

/var/run is emptied at boot time by /etc/rc.d/mountcritlocal, so
there's no point in creating this at install time -- it has to be
created on the fly after /var/run is cleared on every boot anyway.

Mark /var/run/named obsolete in the set lists.  XXX This isn't quite
right, because it is legitimate for /var/run/named to exist in a
running installation, but it doesn't exist in a freshly installed
system any more.  Maybe we should just remove the entry from the set
lists and add a note to UPDATING about deleting it manually from the
destdir in incremental builds.

PR misc/57877


To generate a diff of this commit:
cvs rdiff -u -r1.1330 -r1.1331 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.254 -r1.255 src/etc/mtree/NetBSD.dist.base

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



CVS commit: src/etc/mtree

2024-01-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jan 27 21:01:08 UTC 2024

Modified Files:
src/etc/mtree: NetBSD.dist.base

Log Message:
NetBSD.dist.base: Fix permissions on /dev/pts.

No reason to write to this -- it's expected to have ptyfs mounted,
and ptyfs doesn't allow changing the directory.  So use 0555
(-r-xr-xr-x) instead of 0755 (-rwxr-xr-x), like it is by default with
ptyfs mounted.

PR misc/57877


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.253 src/etc/mtree/NetBSD.dist.base:1.254
--- src/etc/mtree/NetBSD.dist.base:1.253	Sun Sep  3 18:31:01 2023
+++ src/etc/mtree/NetBSD.dist.base	Sat Jan 27 21:01:08 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.253 2023/09/03 18:31:01 riastradh Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.254 2024/01/27 21:01:08 riastradh Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -13,7 +13,7 @@
 ./dev
 ./dev/altq
 ./dev/fd
-./dev/pts
+./dev/pts			mode=0555
 ./etc
 ./etc/X11
 ./etc/X11/fs



CVS commit: src/etc/mtree

2024-01-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jan 27 21:01:08 UTC 2024

Modified Files:
src/etc/mtree: NetBSD.dist.base

Log Message:
NetBSD.dist.base: Fix permissions on /dev/pts.

No reason to write to this -- it's expected to have ptyfs mounted,
and ptyfs doesn't allow changing the directory.  So use 0555
(-r-xr-xr-x) instead of 0755 (-rwxr-xr-x), like it is by default with
ptyfs mounted.

PR misc/57877


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/etc/mtree/NetBSD.dist.base

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



CVS commit: src/share/terminfo

2024-01-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan 27 20:19:21 UTC 2024

Modified Files:
src/share/terminfo: terminfo

Log Message:
terminfo: Our local changes are now upstream; reduce diff to upstream.

The changes look bigger than they are, this also removes some
settings that are inherited from the vt220 entry.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/share/terminfo/terminfo

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

Modified files:

Index: src/share/terminfo/terminfo
diff -u src/share/terminfo/terminfo:1.17 src/share/terminfo/terminfo:1.18
--- src/share/terminfo/terminfo:1.17	Sat Jan 27 19:44:46 2024
+++ src/share/terminfo/terminfo	Sat Jan 27 20:19:21 2024
@@ -1952,14 +1952,12 @@ ofcons|DNARD OpenFirmware console,
 # the level of detail in a termcap, it is a passable emulator, since ECH does
 # work.  Don't use it on a VMS system -TD
 wsvt25|NetBSD wscons in 25 line DEC VT220 mode,
-	bce, msgr,
-	colors#8, cols#80, it#8, lines#25, pairs#64,
-	civis=\E[?25l, cnorm=\E[?25h, is2=\E[r\E[25;1H,
-	kdch1=\E[3~, kend=\E[8~, kf1=\E[11~, kf10=\E[21~,
-	kf11=\E[23~, kf12=\E[24~, kf2=\E[12~, kf3=\E[13~,
-	kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,
-	kf9=\E[20~, khome=\E[7~, op=\E[m, rs1=\Ec,
-	setab=\E[4%p1%dm, setaf=\E[3%p1%dm, use=vt220,
+	bce,
+	colors#8, lines#25, pairs#64,
+	is2=\E[r\E[25;1H, kdch1=\E[3~, kend=\E[8~, kf1=\E[11~,
+	kf2=\E[12~, kf3=\E[13~, kf4=\E[14~, kf5=\E[15~,
+	khome=\E[7~, op=\E[m, rs1=\Ec, setab=\E[4%p1%dm,
+	setaf=\E[3%p1%dm, use=vt220,
 
 wsvt25m|NetBSD wscons in 25 line DEC VT220 mode with Meta,
 	km, use=wsvt25,



CVS commit: src/share/terminfo

2024-01-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan 27 20:19:21 UTC 2024

Modified Files:
src/share/terminfo: terminfo

Log Message:
terminfo: Our local changes are now upstream; reduce diff to upstream.

The changes look bigger than they are, this also removes some
settings that are inherited from the vt220 entry.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/share/terminfo/terminfo

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



CVS commit: src

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 20:03:15 UTC 2024

Modified Files:
src/tests/usr.bin/xlint/lint1: platform_ilp32_c90.c
platform_ilp32_c99.c platform_ilp32_trad.c platform_lp64_c90.c
platform_lp64_c99.c platform_lp64_trad.c
src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: fix type of large integer constants


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/platform_ilp32_c90.c \
src/tests/usr.bin/xlint/lint1/platform_ilp32_c99.c \
src/tests/usr.bin/xlint/lint1/platform_ilp32_trad.c \
src/tests/usr.bin/xlint/lint1/platform_lp64_c90.c \
src/tests/usr.bin/xlint/lint1/platform_lp64_c99.c \
src/tests/usr.bin/xlint/lint1/platform_lp64_trad.c
cvs rdiff -u -r1.202 -r1.203 src/usr.bin/xlint/lint1/lex.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/platform_ilp32_c90.c
diff -u src/tests/usr.bin/xlint/lint1/platform_ilp32_c90.c:1.1 src/tests/usr.bin/xlint/lint1/platform_ilp32_c90.c:1.2
--- src/tests/usr.bin/xlint/lint1/platform_ilp32_c90.c:1.1	Sat Jan 27 15:10:57 2024
+++ src/tests/usr.bin/xlint/lint1/platform_ilp32_c90.c	Sat Jan 27 20:03:14 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: platform_ilp32_c90.c,v 1.1 2024/01/27 15:10:57 rillig Exp $	*/
+/*	$NetBSD: platform_ilp32_c90.c,v 1.2 2024/01/27 20:03:14 rillig Exp $	*/
 # 3 "platform_ilp32_c90.c"
 
 /*
@@ -13,10 +13,12 @@ void *lex_integer[] = {
 	2147483647,
 	/* expect+1: ... integer 'int' ... */
 	0x7fff,
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: ... integer 'unsigned long' ... */
 	2147483648,
 	/* expect+1: ... integer 'unsigned int' ... */
 	0x8000,
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: ... integer 'unsigned long' ... */
 	4294967295,
 	/* expect+1: ... integer 'unsigned int' ... */
@@ -91,10 +93,12 @@ void *lex_integer[] = {
 	2147483647L,
 	/* expect+1: ... integer 'long' ... */
 	0x7fffL,
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: ... integer 'unsigned long' ... */
 	2147483648L,
 	/* expect+1: ... integer 'unsigned long' ... */
 	0x8000L,
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: ... integer 'unsigned long' ... */
 	4294967295L,
 	/* expect+1: ... integer 'unsigned long' ... */
@@ -185,10 +189,12 @@ void *lex_integer[] = {
 	9223372036854775807LL,
 	/* expect+1: ... integer 'long long' ... */
 	0x7fffLL,
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: ... integer 'unsigned long long' ... */
 	9223372036854775808LL,
 	/* expect+1: ... integer 'unsigned long long' ... */
 	0x8000LL,
+	/* expect+2: warning: integer constant out of range [252] */
 	/* expect+1: ... integer 'unsigned long long' ... */
 	18446744073709551615LL,
 	/* expect+1: ... integer 'unsigned long long' ... */
Index: src/tests/usr.bin/xlint/lint1/platform_ilp32_c99.c
diff -u src/tests/usr.bin/xlint/lint1/platform_ilp32_c99.c:1.1 src/tests/usr.bin/xlint/lint1/platform_ilp32_c99.c:1.2
--- src/tests/usr.bin/xlint/lint1/platform_ilp32_c99.c:1.1	Sat Jan 27 15:10:57 2024
+++ src/tests/usr.bin/xlint/lint1/platform_ilp32_c99.c	Sat Jan 27 20:03:14 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: platform_ilp32_c99.c,v 1.1 2024/01/27 15:10:57 rillig Exp $	*/
+/*	$NetBSD: platform_ilp32_c99.c,v 1.2 2024/01/27 20:03:14 rillig Exp $	*/
 # 3 "platform_ilp32_c99.c"
 
 /*
@@ -13,38 +13,36 @@ void *lex_integer[] = {
 	2147483647,
 	/* expect+1: ... integer 'int' ... */
 	0x7fff,
-	/* expect+1: ... integer 'unsigned long' ... */
+	/* expect+1: ... integer 'long long' ... */
 	2147483648,
 	/* expect+1: ... integer 'unsigned int' ... */
 	0x8000,
-	/* expect+1: ... integer 'unsigned long' ... */
+	/* expect+1: ... integer 'long long' ... */
 	4294967295,
 	/* expect+1: ... integer 'unsigned int' ... */
 	0x,
-	/* expect+1: warning: integer constant out of range [252] */
+	/* expect+1: ... integer 'long long' ... */
 	4294967296,
-	/* expect+1: warning: integer constant out of range [252] */
+	/* expect+1: ... integer 'long long' ... */
 	0x0001,
-	/* expect+2: ... integer 'unsigned long' ... */
-	/* expect+1: warning: integer constant out of range [252] */
+	/* expect+1: ... integer 'long long' ... */
 	9223372036854775807,
-	/* expect+2: ... integer 'unsigned long' ... */
-	/* expect+1: warning: integer constant out of range [252] */
+	/* expect+1: ... integer 'long long' ... */
 	0x7fff,
+	/* expect+2: ... integer 'unsigned long long' ... */
 	/* expect+1: warning: integer constant out of range [252] */
 	9223372036854775808,
-	/* expect+1: warning: integer constant out of range [252] */
+	/* expect+1: ... integer 'unsigned long long' ... */
 	0x8000,
-	/* expect+2: ... integer 'unsigned long' ... */
+	/* 

CVS commit: src

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 20:03:15 UTC 2024

Modified Files:
src/tests/usr.bin/xlint/lint1: platform_ilp32_c90.c
platform_ilp32_c99.c platform_ilp32_trad.c platform_lp64_c90.c
platform_lp64_c99.c platform_lp64_trad.c
src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: fix type of large integer constants


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/platform_ilp32_c90.c \
src/tests/usr.bin/xlint/lint1/platform_ilp32_c99.c \
src/tests/usr.bin/xlint/lint1/platform_ilp32_trad.c \
src/tests/usr.bin/xlint/lint1/platform_lp64_c90.c \
src/tests/usr.bin/xlint/lint1/platform_lp64_c99.c \
src/tests/usr.bin/xlint/lint1/platform_lp64_trad.c
cvs rdiff -u -r1.202 -r1.203 src/usr.bin/xlint/lint1/lex.c

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



CVS commit: src/share/terminfo

2024-01-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan 27 19:44:46 UTC 2024

Modified Files:
src/share/terminfo: terminfo

Log Message:
Add missing comma. Noted by Thomas E. Dickey.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/share/terminfo/terminfo

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



CVS commit: src/share/terminfo

2024-01-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jan 27 19:44:46 UTC 2024

Modified Files:
src/share/terminfo: terminfo

Log Message:
Add missing comma. Noted by Thomas E. Dickey.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/share/terminfo/terminfo

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

Modified files:

Index: src/share/terminfo/terminfo
diff -u src/share/terminfo/terminfo:1.16 src/share/terminfo/terminfo:1.17
--- src/share/terminfo/terminfo:1.16	Sat Jan 27 15:53:30 2024
+++ src/share/terminfo/terminfo	Sat Jan 27 19:44:46 2024
@@ -1914,7 +1914,7 @@ arm100-w|arm100-wam|Arm(RiscPC) ncurses 
 # From Minoura Makoto , 12 May 1996
 x68k|x68k-ite|NetBSD/x68k ITE,
 	cols#96, lines#32,
-	kbs=\177 kclr=\E[9~, khlp=\E[28~, use=vt220-base,
+	kbs=\177, kclr=\E[9~, khlp=\E[28~, use=vt220-base,
 
 # :
 # Entry for the DNARD OpenFirmware console, close to ANSI but not quite.



CVS commit: src/lib/libc/stdlib

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 17:58:36 UTC 2024

Modified Files:
src/lib/libc/stdlib: Makefile.inc

Log Message:
fix i386 lint


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/lib/libc/stdlib/Makefile.inc

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

Modified files:

Index: src/lib/libc/stdlib/Makefile.inc
diff -u src/lib/libc/stdlib/Makefile.inc:1.97 src/lib/libc/stdlib/Makefile.inc:1.98
--- src/lib/libc/stdlib/Makefile.inc:1.97	Sat Jan 20 11:45:07 2024
+++ src/lib/libc/stdlib/Makefile.inc	Sat Jan 27 12:58:36 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.97 2024/01/20 16:45:07 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.98 2024/01/27 17:58:36 christos Exp $
 #	from: @(#)Makefile.inc	8.3 (Berkeley) 2/4/95
 
 # stdlib sources
@@ -120,10 +120,12 @@ LINTFLAGS.extent.c += -X 86,161,117,191,
 LINTFLAGS.extent_dss.c += -X 86,117,161,191,193,207,217,226
 LINTFLAGS.extent_mmap.c += -X 86,117,161,191,193,207,217,226
 LINTFLAGS.jemalloc.c += -X 86,117,161,191,193,207,217,226,236,307
+LINTFLAGS.jemalloc.c += -X 141 # i386
 LINTFLAGS.hooks.c += -X 226
 LINTFLAGS.large.c += -X 86,161,117,191,193,207,217,226
 LINTFLAGS.log.c += -X 86,117,161,191,193,207,217,226
 LINTFLAGS.malloc_io.c += -X 86,117,161,191,193,207,217,226,284
+LINTFLAGS.malloc_io.c += -X 132 # i386
 LINTFLAGS.mutex.c += -X 86,117,161,191,193,207,217,226
 LINTFLAGS.mutex_pool.c += -X 86,117,161,191,193,207,217,226
 LINTFLAGS.nstime.c += -X 86,117,161,191,193,207,217,226



CVS commit: src/lib/libc/stdlib

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 17:58:36 UTC 2024

Modified Files:
src/lib/libc/stdlib: Makefile.inc

Log Message:
fix i386 lint


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/lib/libc/stdlib/Makefile.inc

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



CVS commit: src/sys/arch/evbppc/wii/dev

2024-01-27 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat Jan 27 17:44:37 UTC 2024

Modified Files:
src/sys/arch/evbppc/wii/dev: wiifb.c

Log Message:
Add support for "PAL" (576i) mode on Wii.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbppc/wii/dev/wiifb.c

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



CVS commit: src/sys/arch/evbppc/wii/dev

2024-01-27 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat Jan 27 17:44:37 UTC 2024

Modified Files:
src/sys/arch/evbppc/wii/dev: wiifb.c

Log Message:
Add support for "PAL" (576i) mode on Wii.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbppc/wii/dev/wiifb.c

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

Modified files:

Index: src/sys/arch/evbppc/wii/dev/wiifb.c
diff -u src/sys/arch/evbppc/wii/dev/wiifb.c:1.4 src/sys/arch/evbppc/wii/dev/wiifb.c:1.5
--- src/sys/arch/evbppc/wii/dev/wiifb.c:1.4	Tue Jan 23 00:13:37 2024
+++ src/sys/arch/evbppc/wii/dev/wiifb.c	Sat Jan 27 17:44:37 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: wiifb.c,v 1.4 2024/01/23 00:13:37 jmcneill Exp $ */
+/* $NetBSD: wiifb.c,v 1.5 2024/01/27 17:44:37 hgutch Exp $ */
 
 /*-
  * Copyright (c) 2024 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wiifb.c,v 1.4 2024/01/23 00:13:37 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wiifb.c,v 1.5 2024/01/27 17:44:37 hgutch Exp $");
 
 #include 
 #include 
@@ -86,6 +86,13 @@ static const struct wiifb_mode wiifb_mod
 		.height = 480,
 		.lines = 525,
 	},
+	[WIIFB_MODE_INDEX(VI_DCR_FMT_PAL, 1)] = {
+		.name = "PAL 576i",
+		.width = 640,
+		.height = 574,
+		.lines = 625,
+	},
+
 };
 #define WIIFB_NMODES	__arraycount(wiifb_modes)
 
@@ -229,6 +236,15 @@ wiifb_set_mode(struct wiifb_softc *sc, u
 		WR4(sc, VI_VTE, 0x00060030);
 		WR4(sc, VI_BBOI, 0x81d881d8);
 		WR4(sc, VI_BBEI, 0x81d881d8);
+	} else if (modeidx == WIIFB_MODE_INDEX(VI_DCR_FMT_PAL, 1)) {
+		/* PAL 576i */
+		WR2(sc, VI_VTR, 0x11f5);
+		WR4(sc, VI_HTR0, 0x4b6a01b0);
+		WR4(sc, VI_HTR1, 0x02f85640);
+		WR4(sc, VI_VTO, 0x00010023);
+		WR4(sc, VI_VTE, 0x0024);
+		WR4(sc, VI_BBOI, 0x4d2b4d6d);
+		WR4(sc, VI_BBEI, 0x4d8a4d4c);
 	} else {
 		/*
 		 * Display mode is not supported. Blink the slot LED to



CVS commit: src/doc

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 15:55:26 UTC 2024

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new terminfo


To generate a diff of this commit:
cvs rdiff -u -r1.1979 -r1.1980 src/doc/3RDPARTY
cvs rdiff -u -r1.3031 -r1.3032 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1979 src/doc/3RDPARTY:1.1980
--- src/doc/3RDPARTY:1.1979	Wed Jan 24 16:04:08 2024
+++ src/doc/3RDPARTY	Sat Jan 27 10:55:25 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1979 2024/01/24 21:04:08 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1980 2024/01/27 15:55:25 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -2217,12 +2217,12 @@ Location:	sys/external/bsd/ena-com
 Notes:
 
 Package:	terminfo
-Version:	20190609
-Current Vers:	20190609
+Version:	20231209
+Current Vers:	20231209
 Maintainer:	Thomas Dickey (ncurses)
 Archive Site:	ftp://ftp.invisible-island.net/ncurses/current
 Home Page:	https://invisible-island.net/ncurses/
-Date:		2019-11-27
+Date:		2024-01-27
 Mailing List:	bug-ncur...@gnu.org
 Responsible:
 License:	none

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.3031 src/doc/CHANGES:1.3032
--- src/doc/CHANGES:1.3031	Fri Jan 26 05:09:34 2024
+++ src/doc/CHANGES	Sat Jan 27 10:55:25 2024
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3031 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3032 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -269,3 +269,4 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 	evbppc: Add support for the Nintendo Wii. [jmcneill 20240120]
 	libm: Import more long double functions from FreeBSD.
 		[christos 20240121]
+	terminfo: Import 20231209 [christos 20240127]



CVS commit: src/usr.bin/getconf

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 16:04:36 UTC 2024

Modified Files:
src/usr.bin/getconf: getconf.c

Log Message:
PR/57875: Jason Bacon: Try again without an _ for portability.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/getconf/getconf.c

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

Modified files:

Index: src/usr.bin/getconf/getconf.c
diff -u src/usr.bin/getconf/getconf.c:1.36 src/usr.bin/getconf/getconf.c:1.37
--- src/usr.bin/getconf/getconf.c:1.36	Wed Oct 25 04:19:34 2023
+++ src/usr.bin/getconf/getconf.c	Sat Jan 27 11:04:36 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: getconf.c,v 1.36 2023/10/25 08:19:34 simonb Exp $	*/
+/*	$NetBSD: getconf.c,v 1.37 2024/01/27 16:04:36 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: getconf.c,v 1.36 2023/10/25 08:19:34 simonb Exp $");
+__RCSID("$NetBSD: getconf.c,v 1.37 2024/01/27 16:04:36 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -197,7 +197,7 @@ main(int argc, char **argv)
 {
 	int ch;
 	const struct conf_variable *cp;
-	const char *varname, *pathname;
+	const char *varname, *pathname, *vn;
 	int found;
 
 	setprogname(argv[0]);
@@ -230,8 +230,10 @@ main(int argc, char **argv)
 	pathname = argv[0];	/* may be NULL */
 
 	found = 0;
+	vn = varname;
+again:
 	for (cp = conf_table; cp->name != NULL; cp++) {
-		if (a_flag || strcmp(varname, cp->name) == 0) {
+		if (a_flag || strcmp(vn, cp->name) == 0) {
 			/*LINTED weird expression*/
 			if ((cp->type == PATHCONF) == (pathname != NULL)) {
 printvar(cp, pathname);
@@ -242,8 +244,11 @@ main(int argc, char **argv)
 		}
 	}
 
-	if (!a_flag && !found)
+	if (!a_flag && !found) {
+		if (*vn++ == '_')
+			goto again;
 		errx(EXIT_FAILURE, "%s: unknown variable", varname);
+	}
 
 	(void)fflush(stdout);
 	return ferror(stdout) ? EXIT_FAILURE : EXIT_SUCCESS;



CVS commit: src/usr.bin/getconf

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 16:04:36 UTC 2024

Modified Files:
src/usr.bin/getconf: getconf.c

Log Message:
PR/57875: Jason Bacon: Try again without an _ for portability.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/getconf/getconf.c

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



CVS commit: src/doc

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 15:55:26 UTC 2024

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new terminfo


To generate a diff of this commit:
cvs rdiff -u -r1.1979 -r1.1980 src/doc/3RDPARTY
cvs rdiff -u -r1.3031 -r1.3032 src/doc/CHANGES

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



CVS commit: src/share/terminfo

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 15:53:58 UTC 2024

Modified Files:
src/share/terminfo: import

Log Message:
fix quotes


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/terminfo/import

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

Modified files:

Index: src/share/terminfo/import
diff -u src/share/terminfo/import:1.1 src/share/terminfo/import:1.2
--- src/share/terminfo/import:1.1	Wed Nov 27 14:00:25 2019
+++ src/share/terminfo/import	Sat Jan 27 10:53:57 2024
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: import,v 1.1 2019/11/27 19:00:25 christos Exp $
+# $NetBSD: import,v 1.2 2024/01/27 15:53:57 christos Exp $
 #
 # Simple shell script to import the newest version of terminfo
 # Download it from ftp://ftp.invisible-island.net/ncurses/current
@@ -18,7 +18,7 @@ tag=${input%%.src}
 vendor=NCURSES
 
 TMP=$(mktemp -d /tmp/import-terminfo)
-trap rm -fr "${TMP}" 0 1 2 15
+trap "rm -fr ${TMP}" 0 1 2 15
 
 cp "$1" "${TMP}/terminfo"
 cd "${TMP}"



CVS commit: src/share/terminfo

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 15:53:58 UTC 2024

Modified Files:
src/share/terminfo: import

Log Message:
fix quotes


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/terminfo/import

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



CVS commit: src/share/terminfo

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 15:53:30 UTC 2024

Modified Files:
src/share/terminfo: terminfo

Log Message:
merge changes, but keep our old wscons description


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/terminfo/terminfo

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



CVS commit: src/usr.bin/xlint/lint1

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 15:53:28 UTC 2024

Modified Files:
src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: split determining the type of an integer constant

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.201 -r1.202 src/usr.bin/xlint/lint1/lex.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.201 src/usr.bin/xlint/lint1/lex.c:1.202
--- src/usr.bin/xlint/lint1/lex.c:1.201	Sat Jan 27 12:14:58 2024
+++ src/usr.bin/xlint/lint1/lex.c	Sat Jan 27 15:53:27 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.201 2024/01/27 12:14:58 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.202 2024/01/27 15:53:27 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: lex.c,v 1.201 2024/01/27 12:14:58 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.202 2024/01/27 15:53:27 rillig Exp $");
 #endif
 
 #include 
@@ -502,6 +502,67 @@ is_unsigned_since_c90(tspec_t typ, uint6
 	return typ == LONG && ui > TARG_LONG_MAX;
 }
 
+static tspec_t
+integer_constant_type(tspec_t typ, uint64_t ui, int base, bool warned)
+{
+	switch (typ) {
+	case INT:
+		if (ui <= TARG_INT_MAX) {
+			/* ok */
+		} else if (ui <= TARG_UINT_MAX && base != 10) {
+			typ = UINT;
+		} else if (ui <= TARG_LONG_MAX) {
+			typ = LONG;
+		} else {
+			typ = ULONG;
+			if (ui > TARG_ULONG_MAX && !warned) {
+/* integer constant out of range */
+warning(252);
+			}
+		}
+		if ((typ == UINT || typ == ULONG) && !allow_c90)
+			typ = LONG;
+		break;
+	case UINT:
+		if (ui > TARG_UINT_MAX) {
+			typ = ULONG;
+			if (ui > TARG_ULONG_MAX && !warned) {
+/* integer constant out of range */
+warning(252);
+			}
+		}
+		break;
+	case LONG:
+		if (ui > TARG_LONG_MAX && allow_c90) {
+			typ = ULONG;
+			if (ui > TARG_ULONG_MAX && !warned) {
+/* integer constant out of range */
+warning(252);
+			}
+		}
+		break;
+	case ULONG:
+		if (ui > TARG_ULONG_MAX && !warned) {
+			/* integer constant out of range */
+			warning(252);
+		}
+		break;
+	case LLONG:
+		if (ui > TARG_LLONG_MAX && allow_c90)
+			typ = ULLONG;
+		break;
+	case ULLONG:
+		if (ui > TARG_ULLONG_MAX && !warned) {
+			/* integer constant out of range */
+			warning(252);
+		}
+		break;
+	default:
+		break;
+	}
+	return typ;
+}
+
 int
 lex_integer_constant(const char *yytext, size_t yyleng, int base)
 {
@@ -543,7 +604,7 @@ lex_integer_constant(const char *yytext,
 		/* suffix 'U' is illegal in traditional C */
 		warning(97);
 	}
-	tspec_t typ = suffix_type[u_suffix][l_suffix];
+	tspec_t ct = suffix_type[u_suffix][l_suffix];
 
 	bool warned = false;
 	errno = 0;
@@ -561,67 +622,13 @@ lex_integer_constant(const char *yytext,
 		query_message(8, (int)len, cp);
 	}
 
-	bool ansiu = is_unsigned_since_c90(typ, ui, base);
-	switch (typ) {
-	case INT:
-		if (ui <= TARG_INT_MAX) {
-			/* ok */
-		} else if (ui <= TARG_UINT_MAX && base != 10) {
-			typ = UINT;
-		} else if (ui <= TARG_LONG_MAX) {
-			typ = LONG;
-		} else {
-			typ = ULONG;
-			if (ui > TARG_ULONG_MAX && !warned) {
-/* integer constant out of range */
-warning(252);
-			}
-		}
-		if ((typ == UINT || typ == ULONG) && !allow_c90)
-			typ = LONG;
-		break;
-	case UINT:
-		if (ui > TARG_UINT_MAX) {
-			typ = ULONG;
-			if (ui > TARG_ULONG_MAX && !warned) {
-/* integer constant out of range */
-warning(252);
-			}
-		}
-		break;
-	case LONG:
-		if (ui > TARG_LONG_MAX && allow_c90) {
-			typ = ULONG;
-			if (ui > TARG_ULONG_MAX && !warned) {
-/* integer constant out of range */
-warning(252);
-			}
-		}
-		break;
-	case ULONG:
-		if (ui > TARG_ULONG_MAX && !warned) {
-			/* integer constant out of range */
-			warning(252);
-		}
-		break;
-	case LLONG:
-		if (ui > TARG_LLONG_MAX && allow_c90)
-			typ = ULLONG;
-		break;
-	case ULLONG:
-		if (ui > TARG_ULLONG_MAX && !warned) {
-			/* integer constant out of range */
-			warning(252);
-		}
-		break;
-	default:
-		break;
-	}
+	bool ansiu = is_unsigned_since_c90(ct, ui, base);
 
-	ui = (uint64_t)convert_integer((int64_t)ui, typ, 0);
+	tspec_t t = integer_constant_type(ct, ui, base, warned);
+	ui = (uint64_t)convert_integer((int64_t)ui, t, 0);
 
 	yylval.y_val = xcalloc(1, sizeof(*yylval.y_val));
-	yylval.y_val->v_tspec = typ;
+	yylval.y_val->v_tspec = t;
 	yylval.y_val->v_unsigned_since_c90 = ansiu;
 	yylval.y_val->u.integer = (int64_t)ui;
 



CVS commit: src/usr.bin/xlint/lint1

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 15:53:28 UTC 2024

Modified Files:
src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: split determining the type of an integer constant

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.201 -r1.202 src/usr.bin/xlint/lint1/lex.c

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



CVS import: src/share/terminfo

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 15:48:26 UTC 2024

Update of /cvsroot/src/share/terminfo
In directory ivanova.netbsd.org:/tmp/cvs-serv28647

Log Message:
Import terminfo-20231209.src

Status:

Vendor Tag: NCURSES
Release Tags:   terminfo-20231209

C src/share/terminfo/terminfo

1 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jNCURSES:yesterday -jNCURSES src/share/terminfo



CVS import: src/share/terminfo

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 15:48:26 UTC 2024

Update of /cvsroot/src/share/terminfo
In directory ivanova.netbsd.org:/tmp/cvs-serv28647

Log Message:
Import terminfo-20231209.src

Status:

Vendor Tag: NCURSES
Release Tags:   terminfo-20231209

C src/share/terminfo/terminfo

1 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jNCURSES:yesterday -jNCURSES src/share/terminfo



CVS commit: src

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 15:10:57 UTC 2024

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/xlint/lint1: check-expect.lua msg_252.c
Added Files:
src/tests/usr.bin/xlint/lint1: platform_ilp32_c90.c
platform_ilp32_c99.c platform_ilp32_trad.c platform_lp64_c90.c
platform_lp64_c99.c platform_lp64_trad.c

Log Message:
tests/lint: test integer constants in different language levels


To generate a diff of this commit:
cvs rdiff -u -r1.1301 -r1.1302 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/check-expect.lua
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_252.c
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/platform_ilp32_c90.c \
src/tests/usr.bin/xlint/lint1/platform_ilp32_c99.c \
src/tests/usr.bin/xlint/lint1/platform_ilp32_trad.c \
src/tests/usr.bin/xlint/lint1/platform_lp64_c90.c \
src/tests/usr.bin/xlint/lint1/platform_lp64_c99.c \
src/tests/usr.bin/xlint/lint1/platform_lp64_trad.c

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1301 src/distrib/sets/lists/tests/mi:1.1302
--- src/distrib/sets/lists/tests/mi:1.1301	Thu Jan 25 01:43:58 2024
+++ src/distrib/sets/lists/tests/mi	Sat Jan 27 15:10:56 2024
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1301 2024/01/25 01:43:58 mrg Exp $
+# $NetBSD: mi,v 1.1302 2024/01/27 15:10:56 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -7481,8 +7481,11 @@
 ./usr/tests/usr.bin/xlint/lint1/parse_type_name.exp		tests-obsolete		obsolete,atf
 ./usr/tests/usr.bin/xlint/lint1/platform_ilp32.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/platform_ilp32.exp		tests-obsolete		obsolete,atf
+./usr/tests/usr.bin/xlint/lint1/platform_ilp32_c90.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/platform_ilp32_c99.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/platform_ilp32_int.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/platform_ilp32_long.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/platform_ilp32_trad.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/platform_int.c			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/platform_int.exp		tests-obsolete		obsolete,atf
 ./usr/tests/usr.bin/xlint/lint1/platform_ldbl128.c		tests-usr.bin-tests	compattestfile,atf
@@ -7495,6 +7498,9 @@
 ./usr/tests/usr.bin/xlint/lint1/platform_long.exp		tests-obsolete		obsolete,atf
 ./usr/tests/usr.bin/xlint/lint1/platform_lp64.c			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/platform_lp64.exp		tests-obsolete		obsolete,atf
+./usr/tests/usr.bin/xlint/lint1/platform_lp64_c90.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/platform_lp64_c99.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/platform_lp64_trad.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/platform_schar.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/platform_schar.exp		tests-obsolete		obsolete,atf
 ./usr/tests/usr.bin/xlint/lint1/platform_uchar.c		tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/xlint/lint1/check-expect.lua
diff -u src/tests/usr.bin/xlint/lint1/check-expect.lua:1.8 src/tests/usr.bin/xlint/lint1/check-expect.lua:1.9
--- src/tests/usr.bin/xlint/lint1/check-expect.lua:1.8	Fri Aug 11 04:27:49 2023
+++ src/tests/usr.bin/xlint/lint1/check-expect.lua	Sat Jan 27 15:10:57 2024
@@ -1,9 +1,9 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.8 2023/08/11 04:27:49 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.9 2024/01/27 15:10:57 rillig Exp $
 
 --[[
 
-usage: lua ./check-expect.lua *.c
+usage: lua ./check-expect.lua [-u] *.c
 
 Check that the /* expect+-n: ... */ comments in the .c source files match the
 actual messages found in the corresponding .exp files.  The .exp files are

Index: src/tests/usr.bin/xlint/lint1/msg_252.c
diff -u src/tests/usr.bin/xlint/lint1/msg_252.c:1.6 src/tests/usr.bin/xlint/lint1/msg_252.c:1.7
--- src/tests/usr.bin/xlint/lint1/msg_252.c:1.6	Sun Jul  2 18:14:44 2023
+++ src/tests/usr.bin/xlint/lint1/msg_252.c	Sat Jan 27 15:10:57 2024
@@ -1,9 +1,19 @@
-/*	$NetBSD: msg_252.c,v 1.6 2023/07/02 18:14:44 rillig Exp $	*/
+/*	$NetBSD: msg_252.c,v 1.7 2024/01/27 15:10:57 rillig Exp $	*/
 # 3 "msg_252.c"
 
 // Test for message: integer constant out of range [252]
 
 /*
+ * See also:
+ *	platform_ilp32_trad.c
+ *	platform_ilp32_c90.c
+ *	platform_ilp32_c99.c
+ *	platform_lp64_trad.c
+ *	platform_lp64_c90.c
+ *	platform_lp64_c99.c
+ */
+
+/*
  * On ILP32 platforms, lint additionally and unnecessarily warns:
  

CVS commit: src

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 15:10:57 UTC 2024

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/xlint/lint1: check-expect.lua msg_252.c
Added Files:
src/tests/usr.bin/xlint/lint1: platform_ilp32_c90.c
platform_ilp32_c99.c platform_ilp32_trad.c platform_lp64_c90.c
platform_lp64_c99.c platform_lp64_trad.c

Log Message:
tests/lint: test integer constants in different language levels


To generate a diff of this commit:
cvs rdiff -u -r1.1301 -r1.1302 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/check-expect.lua
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_252.c
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/platform_ilp32_c90.c \
src/tests/usr.bin/xlint/lint1/platform_ilp32_c99.c \
src/tests/usr.bin/xlint/lint1/platform_ilp32_trad.c \
src/tests/usr.bin/xlint/lint1/platform_lp64_c90.c \
src/tests/usr.bin/xlint/lint1/platform_lp64_c99.c \
src/tests/usr.bin/xlint/lint1/platform_lp64_trad.c

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



CVS commit: src/usr.bin/xlint/lint1

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 12:14:58 UTC 2024

Modified Files:
src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: extract signedness detection from lexing an integer constant

An integer constant that is signed in traditional C but unsigned since
C90 is an edge case that should not clutter the main code of determining
the resulting type of the constant.

The code for lexing an integer constant doesn't implement the C99 rules
yet, which convert a constant to the 'long long' types if the 'long'
types don't suffice.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/usr.bin/xlint/lint1/lex.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.200 src/usr.bin/xlint/lint1/lex.c:1.201
--- src/usr.bin/xlint/lint1/lex.c:1.200	Tue Jan 23 19:44:28 2024
+++ src/usr.bin/xlint/lint1/lex.c	Sat Jan 27 12:14:58 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.200 2024/01/23 19:44:28 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.201 2024/01/27 12:14:58 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: lex.c,v 1.200 2024/01/23 19:44:28 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.201 2024/01/27 12:14:58 rillig Exp $");
 #endif
 
 #include 
@@ -487,6 +487,21 @@ lex_name(const char *yytext, size_t yyle
 	return T_NAME;
 }
 
+// Determines whether the constant is signed in traditional C but unsigned in
+// C90 and later.
+static bool
+is_unsigned_since_c90(tspec_t typ, uint64_t ui, int base)
+{
+	if (!(allow_trad && allow_c90))
+		return false;
+	if (typ == INT) {
+		if (ui > TARG_INT_MAX && ui <= TARG_UINT_MAX && base != 10)
+			return true;
+		return ui > TARG_LONG_MAX;
+	}
+	return typ == LONG && ui > TARG_LONG_MAX;
+}
+
 int
 lex_integer_constant(const char *yytext, size_t yyleng, int base)
 {
@@ -546,11 +561,7 @@ lex_integer_constant(const char *yytext,
 		query_message(8, (int)len, cp);
 	}
 
-	/*
-	 * If the value is too big for the current type, we must choose another
-	 * type.
-	 */
-	bool ansiu = false;
+	bool ansiu = is_unsigned_since_c90(typ, ui, base);
 	switch (typ) {
 	case INT:
 		if (ui <= TARG_INT_MAX) {
@@ -566,17 +577,8 @@ lex_integer_constant(const char *yytext,
 warning(252);
 			}
 		}
-		if (typ == UINT || typ == ULONG) {
-			if (!allow_c90) {
-typ = LONG;
-			} else if (allow_trad) {
-/*
- * Remember that the constant is unsigned only
- * in C90.
- */
-ansiu = true;
-			}
-		}
+		if ((typ == UINT || typ == ULONG) && !allow_c90)
+			typ = LONG;
 		break;
 	case UINT:
 		if (ui > TARG_UINT_MAX) {
@@ -590,8 +592,6 @@ lex_integer_constant(const char *yytext,
 	case LONG:
 		if (ui > TARG_LONG_MAX && allow_c90) {
 			typ = ULONG;
-			if (allow_trad)
-ansiu = true;
 			if (ui > TARG_ULONG_MAX && !warned) {
 /* integer constant out of range */
 warning(252);



CVS commit: src/usr.bin/xlint/lint1

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 12:14:58 UTC 2024

Modified Files:
src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: extract signedness detection from lexing an integer constant

An integer constant that is signed in traditional C but unsigned since
C90 is an edge case that should not clutter the main code of determining
the resulting type of the constant.

The code for lexing an integer constant doesn't implement the C99 rules
yet, which convert a constant to the 'long long' types if the 'long'
types don't suffice.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/usr.bin/xlint/lint1/lex.c

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



CVS commit: src/external/mit/xorg/server/xorg-server.old

2024-01-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jan 27 10:57:05 UTC 2024

Modified Files:
src/external/mit/xorg/server/xorg-server.old: Makefile.servermod
src/external/mit/xorg/server/xorg-server.old/hw/xfree86/dixmods/fb:
Makefile

Log Message:
Revert previous (stop building static libfb.a module for Xorg 1.10).

It breaks builds in xorg-server.old/hw/xfree86/Xorg on alpha,
netwinder, and sgimips (but not vax).

>> dependall ===> external/mit/xorg/server/xorg-server.old/hw/xfree86/Xorg
>> nbmake[13]: don't know how to make 
>> [...]/xorg-server.old/hw/xfree86/dixmods/fb/libfb.a. Stop


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/mit/xorg/server/xorg-server.old/Makefile.servermod
cvs rdiff -u -r1.2 -r1.3 \
src/external/mit/xorg/server/xorg-server.old/hw/xfree86/dixmods/fb/Makefile

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

Modified files:

Index: src/external/mit/xorg/server/xorg-server.old/Makefile.servermod
diff -u src/external/mit/xorg/server/xorg-server.old/Makefile.servermod:1.6 src/external/mit/xorg/server/xorg-server.old/Makefile.servermod:1.7
--- src/external/mit/xorg/server/xorg-server.old/Makefile.servermod:1.6	Fri Jan 26 11:32:12 2024
+++ src/external/mit/xorg/server/xorg-server.old/Makefile.servermod	Sat Jan 27 10:57:04 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.servermod,v 1.6 2024/01/26 11:32:12 tsutsui Exp $
+#	$NetBSD: Makefile.servermod,v 1.7 2024/01/27 10:57:04 tsutsui Exp $
 
 NOFULLRELRO=	yes
 
@@ -7,7 +7,7 @@ NOFULLRELRO=	yes
 .if defined(XMODULEDIR)
 SHLIB_MAJOR=0
 
-# dri and dri2 need to be linked statically as well?
+# dri, dri2 and fb need to be linked statically as well?
 .if !defined(XMODULEDIRANDSTATIC)
 MKSTATICLIB:=	no
 .endif

Index: src/external/mit/xorg/server/xorg-server.old/hw/xfree86/dixmods/fb/Makefile
diff -u src/external/mit/xorg/server/xorg-server.old/hw/xfree86/dixmods/fb/Makefile:1.2 src/external/mit/xorg/server/xorg-server.old/hw/xfree86/dixmods/fb/Makefile:1.3
--- src/external/mit/xorg/server/xorg-server.old/hw/xfree86/dixmods/fb/Makefile:1.2	Fri Jan 26 11:32:12 2024
+++ src/external/mit/xorg/server/xorg-server.old/hw/xfree86/dixmods/fb/Makefile	Sat Jan 27 10:57:05 2024
@@ -1,6 +1,7 @@
-#	$NetBSD: Makefile,v 1.2 2024/01/26 11:32:12 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.3 2024/01/27 10:57:05 tsutsui Exp $
 
 XMODULEDIR=	${X11USRLIBDIR}/modules
+XMODULEDIRANDSTATIC=	# defined
 
 .include "../../../../Makefile.serverlib"
 .include "../../../../Makefile.servermod"



CVS commit: src/external/mit/xorg/server/xorg-server.old

2024-01-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jan 27 10:57:05 UTC 2024

Modified Files:
src/external/mit/xorg/server/xorg-server.old: Makefile.servermod
src/external/mit/xorg/server/xorg-server.old/hw/xfree86/dixmods/fb:
Makefile

Log Message:
Revert previous (stop building static libfb.a module for Xorg 1.10).

It breaks builds in xorg-server.old/hw/xfree86/Xorg on alpha,
netwinder, and sgimips (but not vax).

>> dependall ===> external/mit/xorg/server/xorg-server.old/hw/xfree86/Xorg
>> nbmake[13]: don't know how to make 
>> [...]/xorg-server.old/hw/xfree86/dixmods/fb/libfb.a. Stop


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/mit/xorg/server/xorg-server.old/Makefile.servermod
cvs rdiff -u -r1.2 -r1.3 \
src/external/mit/xorg/server/xorg-server.old/hw/xfree86/dixmods/fb/Makefile

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



CVS commit: src/tests/lib/libutil

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 10:32:03 UTC 2024

Modified Files:
src/tests/lib/libutil: t_snprintb.c

Log Message:
tests/libutil/snprintb: fix test for 32-bit platforms


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libutil/t_snprintb.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/lib/libutil/t_snprintb.c
diff -u src/tests/lib/libutil/t_snprintb.c:1.10 src/tests/lib/libutil/t_snprintb.c:1.11
--- src/tests/lib/libutil/t_snprintb.c:1.10	Sat Jan 27 08:54:15 2024
+++ src/tests/lib/libutil/t_snprintb.c	Sat Jan 27 10:32:03 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: t_snprintb.c,v 1.10 2024/01/27 08:54:15 rillig Exp $ */
+/* $NetBSD: t_snprintb.c,v 1.11 2024/01/27 10:32:03 rillig Exp $ */
 
 /*
  * Copyright (c) 2002, 2004, 2008, 2010, 2024 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008, 2010\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_snprintb.c,v 1.10 2024/01/27 08:54:15 rillig Exp $");
+__RCSID("$NetBSD: t_snprintb.c,v 1.11 2024/01/27 10:32:03 rillig Exp $");
 
 #include 
 #include 
@@ -81,7 +81,8 @@ h_snprintb_loc(const char *file, size_t 
 	"\twant: %d bytes %s\n"
 	"\thave: %d bytes %s\n",
 	file, line,
-	vis_arr(fmt, fmtlen), (uintmax_t)val,
+	vis_arr(fmt, fmtlen),
+	(uintmax_t)val,
 	exp_rv, vis_arr(res, reslen),
 	rv, vis_arr(buf, reslen));
 }
@@ -180,7 +181,7 @@ ATF_TC_BODY(snprintb, tc)
 	// The old-style format supports only 32 bits, interpreting the
 	// \041 as part of the text belonging to bit 32.
 	"\04133",
-	0xff00f0ca,
+	0xff00f0caULL,
 	"0xff00f0ca<2,4,7,8,16,32!33>");
 
 	// The bits can be listed in arbitrary order, there can also be
@@ -207,7 +208,7 @@ ATF_TC_BODY(snprintb, tc)
 	"\020"
 	"\177undefined_behavior"
 	"\001lsb",
-	0x,
+	0xULL,
 	"0x");
 #endif
 
@@ -592,7 +593,8 @@ h_snprintb_m_loc(const char *file, size_
 	"\twant: %zu bytes %s\n"
 	"\thave: %zu bytes %s\n",
 	file, line,
-	vis_arr(fmt, fmtlen), (uintmax_t)val,
+	vis_arr(fmt, fmtlen),
+	(uintmax_t)val,
 	reslen, vis_arr(res, reslen),
 	buflen, vis_arr(buf, buflen));
 }



CVS commit: src/tests/lib/libutil

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 10:32:03 UTC 2024

Modified Files:
src/tests/lib/libutil: t_snprintb.c

Log Message:
tests/libutil/snprintb: fix test for 32-bit platforms


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libutil/t_snprintb.c

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



CVS commit: src/tests/lib/libutil

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 08:54:15 UTC 2024

Modified Files:
src/tests/lib/libutil: t_snprintb.c

Log Message:
tests/libutil/snprintb: add more tests

Test all number bases (octal, decimal, hexadecimal), in both old-style
and new-style formats, as well as small buffer sizes.

Document working edge cases such as empty descriptions or descriptions
containing spaces, as well as situations that invoke undefined behavior.

Add comments to the individual test cases, as reading the actual format
strings takes more time.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libutil/t_snprintb.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/lib/libutil/t_snprintb.c
diff -u src/tests/lib/libutil/t_snprintb.c:1.9 src/tests/lib/libutil/t_snprintb.c:1.10
--- src/tests/lib/libutil/t_snprintb.c:1.9	Thu Jan 25 18:13:14 2024
+++ src/tests/lib/libutil/t_snprintb.c	Sat Jan 27 08:54:15 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: t_snprintb.c,v 1.9 2024/01/25 18:13:14 rillig Exp $ */
+/* $NetBSD: t_snprintb.c,v 1.10 2024/01/27 08:54:15 rillig Exp $ */
 
 /*
  * Copyright (c) 2002, 2004, 2008, 2010, 2024 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008, 2010\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_snprintb.c,v 1.9 2024/01/25 18:13:14 rillig Exp $");
+__RCSID("$NetBSD: t_snprintb.c,v 1.10 2024/01/27 08:54:15 rillig Exp $");
 
 #include 
 #include 
@@ -42,47 +42,80 @@ __RCSID("$NetBSD: t_snprintb.c,v 1.9 202
 #include 
 
 static const char *
-vis_fmt(const char *fmt, size_t fmtlen)
+vis_arr(const char *arr, size_t arrlen)
 {
-	static char buf[4][1024];
+	static char buf[6][1024];
 	static size_t i;
 
-	i = (i + 1) % 4;
-	ATF_REQUIRE_MSG(
-	strnvisx(buf[i], sizeof(buf[i]), fmt, fmtlen, VIS_WHITE | VIS_OCTAL) >= 0,
-	"strnvisx failed for length %zu", fmtlen);
+	i = (i + 1) % (sizeof(buf) / sizeof(buf[0]));
+	int rv = strnvisx(buf[i], sizeof(buf[i]), arr, arrlen,
+	VIS_WHITE | VIS_OCTAL);
+	ATF_REQUIRE_MSG(rv >= 0, "strnvisx failed for length %zu", arrlen);
 	return buf[i];
 }
 
 static void
-h_snprintb(const char *file, size_t line, const char *fmt, size_t fmtlen, uint64_t val,
-const char *res, size_t reslen)
+h_snprintb_loc(const char *file, size_t line,
+size_t bufsize, const char *fmt, size_t fmtlen, uint64_t val,
+int exp_rv, const char *res, size_t reslen)
 {
 	char buf[1024];
 
-	int rv = snprintb(buf, sizeof(buf), fmt, val);
-
-	ATF_REQUIRE_MSG(rv > 0, "formatting %jx with '%s' returns error %d",
-	(uintmax_t)val, vis_fmt(fmt, fmtlen), rv);
+	// Calling snprintb with bufsize == 0 invokes undefined
+	// behavior due to out-of-range 'bp'.
+	ATF_REQUIRE(bufsize > 0);
+	ATF_REQUIRE(bufsize <= sizeof(buf));
+
+	memset(buf, 'Z', sizeof(buf));
+	int rv = snprintb(buf, bufsize, fmt, val);
+	ATF_REQUIRE(rv >= 0);
+	size_t rlen = rv;
 
-	size_t buflen = rv;
 	ATF_CHECK_MSG(
-	buflen == reslen && memcmp(buf, res, reslen) == 0,
+	rv == exp_rv && memcmp(buf, res, reslen) == 0
+	&& buf[rlen < bufsize ? rlen : bufsize - 1] == '\0',
 	"failed:\n"
 	"\ttest case: %s:%zu\n"
 	"\tformat: %s\n"
 	"\tvalue: %#jx\n"
-	"\twant: %3zu bytes %s\n"
-	"\thave: %3zu bytes %s\n",
+	"\twant: %d bytes %s\n"
+	"\thave: %d bytes %s\n",
 	file, line,
-	vis_fmt(fmt, fmtlen), (uintmax_t)val,
-	reslen, vis_fmt(res, reslen),
-	buflen, vis_fmt(buf, buflen));
+	vis_arr(fmt, fmtlen), (uintmax_t)val,
+	exp_rv, vis_arr(res, reslen),
+	rv, vis_arr(buf, reslen));
 }
 
+#define	h_snprintb_len(bufsize, fmt, val, exp_rv, res)			\
+	h_snprintb_loc(__FILE__, __LINE__,\
+	bufsize, fmt, sizeof(fmt) - 1, val,\
+	exp_rv, res, sizeof(res) - 1)
 #define	h_snprintb(fmt, val, res)	\
-	h_snprintb(__FILE__, __LINE__, fmt, sizeof(fmt) - 1,		\
-	val, res, sizeof(res) - 1)
+	h_snprintb_len(1024, fmt, val, sizeof(res) - 1, res)
+
+static void
+h_snprintb_error_loc(const char *file, size_t line,
+const char *fmt, size_t fmtlen)
+{
+	char buf[1024];
+
+	memset(buf, 'Z', sizeof(buf));
+	int rv = snprintb(buf, sizeof(buf), fmt, 0);
+	size_t buflen = rv;
+
+	ATF_REQUIRE(rv >= -1);
+	ATF_CHECK_MSG(rv == -1,
+	"expected error but got success:\n"
+	"\ttest case: %s:%zu\n"
+	"\tformat: %s\n"
+	"\tresult: %zu bytes %s\n",
+	file, line,
+	vis_arr(fmt, fmtlen),
+	buflen, vis_arr(buf, buflen));
+}
+
+#define	h_snprintb_error(fmt)		\
+	h_snprintb_error_loc(__FILE__, __LINE__, fmt, sizeof(fmt) - 1)
 
 ATF_TC(snprintb);
 ATF_TC_HEAD(snprintb, tc)
@@ -91,6 +124,8 @@ ATF_TC_HEAD(snprintb, tc)
 }
 ATF_TC_BODY(snprintb, tc)
 {
+
+	// old-style format, octal
 	h_snprintb(
 	"\010"
 	"\002BITTWO"
@@ -98,14 +133,189 @@ ATF_TC_BODY(snprintb, tc)
 	3,
 	"03");
 
+	// old-style format, decimal
 	

CVS commit: src/tests/lib/libutil

2024-01-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jan 27 08:54:15 UTC 2024

Modified Files:
src/tests/lib/libutil: t_snprintb.c

Log Message:
tests/libutil/snprintb: add more tests

Test all number bases (octal, decimal, hexadecimal), in both old-style
and new-style formats, as well as small buffer sizes.

Document working edge cases such as empty descriptions or descriptions
containing spaces, as well as situations that invoke undefined behavior.

Add comments to the individual test cases, as reading the actual format
strings takes more time.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libutil/t_snprintb.c

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