CVS commit: src

2024-03-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 30 16:47:45 UTC 2024

Modified Files:
src/tests/usr.bin/xlint/lint1: d_c99_init.c msg_167.c msg_168.c
platform_ilp32_int.c platform_ilp32_long.c platform_lp64.c
src/usr.bin/xlint/lint1: err.c init.c tree.c

Log Message:
lint: reword messages about array subscripts to sound more natural


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/tests/usr.bin/xlint/lint1/d_c99_init.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_167.c \
src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/msg_168.c
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/platform_ilp32_long.c
cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/lint1/platform_lp64.c
cvs rdiff -u -r1.236 -r1.237 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.266 -r1.267 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.629 -r1.630 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.



CVS commit: src

2024-03-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 30 16:47:45 UTC 2024

Modified Files:
src/tests/usr.bin/xlint/lint1: d_c99_init.c msg_167.c msg_168.c
platform_ilp32_int.c platform_ilp32_long.c platform_lp64.c
src/usr.bin/xlint/lint1: err.c init.c tree.c

Log Message:
lint: reword messages about array subscripts to sound more natural


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/tests/usr.bin/xlint/lint1/d_c99_init.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_167.c \
src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/msg_168.c
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/platform_ilp32_long.c
cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/lint1/platform_lp64.c
cvs rdiff -u -r1.236 -r1.237 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.266 -r1.267 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.629 -r1.630 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/d_c99_init.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.47 src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.48
--- src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.47	Sun Jan 28 08:17:27 2024
+++ src/tests/usr.bin/xlint/lint1/d_c99_init.c	Sat Mar 30 16:47:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: d_c99_init.c,v 1.47 2024/01/28 08:17:27 rillig Exp $	*/
+/*	$NetBSD: d_c99_init.c,v 1.48 2024/03/30 16:47:45 rillig Exp $	*/
 # 3 "d_c99_init.c"
 
 /*
@@ -238,11 +238,11 @@ struct geometry geometry = {
 	.pentagons[0].points[4].x = 1,
 	.points[0][0][0] = { 0, 0 },
 	.points[2][4][1] = {301, 302 },
-	/* expect+1: error: array subscript cannot be > 2: 3 [168] */
+	/* expect+1: error: array subscript 3 cannot be > 2 [168] */
 	.points[3][0][0] = {3001, 3002 },
-	/* expect+1: error: array subscript cannot be > 4: 5 [168] */
+	/* expect+1: error: array subscript 5 cannot be > 4 [168] */
 	.points[0][5][0] = {501, 502 },
-	/* expect+1: error: array subscript cannot be > 1: 2 [168] */
+	/* expect+1: error: array subscript 2 cannot be > 1 [168] */
 	.points[0][0][2] = {21, 22 },
 };
 

Index: src/tests/usr.bin/xlint/lint1/msg_167.c
diff -u src/tests/usr.bin/xlint/lint1/msg_167.c:1.6 src/tests/usr.bin/xlint/lint1/msg_167.c:1.7
--- src/tests/usr.bin/xlint/lint1/msg_167.c:1.6	Wed Mar 27 19:28:20 2024
+++ src/tests/usr.bin/xlint/lint1/msg_167.c	Sat Mar 30 16:47:45 2024
@@ -1,7 +1,7 @@
-/*	$NetBSD: msg_167.c,v 1.6 2024/03/27 19:28:20 rillig Exp $	*/
+/*	$NetBSD: msg_167.c,v 1.7 2024/03/30 16:47:45 rillig Exp $	*/
 # 3 "msg_167.c"
 
-// Test for message: array subscript cannot be negative: %jd [167]
+// Test for message: array subscript %jd cannot be negative [167]
 
 /* lint1-extra-flags: -X 351 */
 
@@ -10,7 +10,7 @@ example(int *ptr)
 {
 	int arr[6];
 
-	/* expect+1: warning: array subscript cannot be negative: -3 [167] */
+	/* expect+1: warning: array subscript -3 cannot be negative [167] */
 	arr[-3] = 13;
 
 	/*
Index: src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c
diff -u src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c:1.6 src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c:1.7
--- src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c:1.6	Sun Mar 10 19:45:14 2024
+++ src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c	Sat Mar 30 16:47:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: platform_ilp32_int.c,v 1.6 2024/03/10 19:45:14 rillig Exp $	*/
+/*	$NetBSD: platform_ilp32_int.c,v 1.7 2024/03/30 16:47:45 rillig Exp $	*/
 # 3 "platform_ilp32_int.c"
 
 /*
@@ -37,69 +37,69 @@ void
 array_index(void)
 {
 
-	/* expect+1: warning: array subscript cannot be > 19: 16777215 [168] */
+	/* expect+1: warning: array subscript 16777215 cannot be > 19 [168] */
 	u8 += u8_buf[0x00ff];
-	/* expect+1: warning: array subscript cannot be > 19: 2147483647 [168] */
+	/* expect+1: warning: array subscript 2147483647 cannot be > 19 [168] */
 	u8 += u8_buf[0x7fff];
 	/* expect+2: warning: conversion of 'long long' to 'int' is out of range [119] */
-	/* expect+1: warning: array subscript cannot be negative: -2147483648 [167] */
+	/* expect+1: warning: array subscript -2147483648 cannot be negative [167] */
 	u8 += u8_buf[2147483648];
 	/* expect+2: warning: conversion of 'unsigned int' to 'int' is out of range [119] */
-	/* expect+1: warning: array subscript cannot be negative: -2147483648 [167] */
+	/* expect+1: warning: array subscript -2147483648 cannot be negative [167] */
 	u8 += u8_buf[0x8000];
 	/* expect+2: warning: conversion of 'unsigned int' to 'int' is out of range [119] */
-	/* expect+1: warning: array subscript cannot be negative: -1 [167] */
+	/* expect+1: warning: array subscript -1 cannot be negative [167] */
 	u8 += u8_buf[0x];
 	/* expect+2: warning: conversion of 'unsigned int' to 'int' is out of range [119] */
-	/* expect+1: warning: array subscript cannot be negative

CVS commit: src

2024-03-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Mar 30 16:47:55 UTC 2024

Modified Files:
src/distrib/sets/lists/base: mi
src/share/examples/devpubd/hooks: Makefile
Added Files:
src/share/examples/devpubd/hooks: 99-ugen-perms-minipro

Log Message:
Add an example devpubd hook that looks for Minipro-compatible EEPROM
programmers and sets the access permissions to 0660.


To generate a diff of this commit:
cvs rdiff -u -r1.1337 -r1.1338 src/distrib/sets/lists/base/mi
cvs rdiff -u -r0 -r1.1 src/share/examples/devpubd/hooks/99-ugen-perms-minipro
cvs rdiff -u -r1.2 -r1.3 src/share/examples/devpubd/hooks/Makefile

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



CVS commit: src

2024-03-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Mar 30 16:47:55 UTC 2024

Modified Files:
src/distrib/sets/lists/base: mi
src/share/examples/devpubd/hooks: Makefile
Added Files:
src/share/examples/devpubd/hooks: 99-ugen-perms-minipro

Log Message:
Add an example devpubd hook that looks for Minipro-compatible EEPROM
programmers and sets the access permissions to 0660.


To generate a diff of this commit:
cvs rdiff -u -r1.1337 -r1.1338 src/distrib/sets/lists/base/mi
cvs rdiff -u -r0 -r1.1 src/share/examples/devpubd/hooks/99-ugen-perms-minipro
cvs rdiff -u -r1.2 -r1.3 src/share/examples/devpubd/hooks/Makefile

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.1337 src/distrib/sets/lists/base/mi:1.1338
--- src/distrib/sets/lists/base/mi:1.1337	Sat Mar 30 06:42:10 2024
+++ src/distrib/sets/lists/base/mi	Sat Mar 30 16:47:55 2024
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1337 2024/03/30 06:42:10 thorpej Exp $
+# $NetBSD: mi,v 1.1338 2024/03/30 16:47:55 thorpej Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -2488,6 +2488,7 @@
 ./usr/share/examples/devpubd			base-sys-examples
 ./usr/share/examples/devpubd/hooks		base-sys-examples
 ./usr/share/examples/devpubd/hooks/99-ucom-symlinks	base-sys-examples
+./usr/share/examples/devpubd/hooks/99-ugen-perms-minipro base-sys-examples
 ./usr/share/examples/devpubd/hooks/99-ugen-perms-tigard	base-sys-examples
 ./usr/share/examples/dhcp			base-dhcpd-examples
 ./usr/share/examples/dhcpcd			base-dhcpcd-examples

Index: src/share/examples/devpubd/hooks/Makefile
diff -u src/share/examples/devpubd/hooks/Makefile:1.2 src/share/examples/devpubd/hooks/Makefile:1.3
--- src/share/examples/devpubd/hooks/Makefile:1.2	Sat Mar 30 06:42:10 2024
+++ src/share/examples/devpubd/hooks/Makefile	Sat Mar 30 16:47:55 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2024/03/30 06:42:10 thorpej Exp $
+#	$NetBSD: Makefile,v 1.3 2024/03/30 16:47:55 thorpej Exp $
 
 NOOBJ=	# defined
 
@@ -6,6 +6,7 @@ NOOBJ=	# defined
 
 .if ${MKSHARE} != "no"
 FILES=	99-ucom-symlinks
+FILES+=	99-ugen-perms-minipro
 FILES+=	99-ugen-perms-tigard
 FILESDIR=/usr/share/examples/devpubd/hooks
 .endif

Added files:

Index: src/share/examples/devpubd/hooks/99-ugen-perms-minipro
diff -u /dev/null src/share/examples/devpubd/hooks/99-ugen-perms-minipro:1.1
--- /dev/null	Sat Mar 30 16:47:55 2024
+++ src/share/examples/devpubd/hooks/99-ugen-perms-minipro	Sat Mar 30 16:47:55 2024
@@ -0,0 +1,144 @@
+#!/bin/sh -x
+#
+# $NetBSD: 99-ugen-perms-minipro,v 1.1 2024/03/30 16:47:55 thorpej Exp $
+#
+# Look for a "Minipro" (https://gitlab.com/DavidGriffith/minipro) compatible
+# EEPROM programmer and change change the permissions to 0660.
+#
+# Written by Jason R. Thorpe, March 2024.  Public domain.
+#
+
+export LC_ALL=C
+
+event="$1"
+shift
+devices=$@
+
+orig_perms=0600
+new_perms=0660
+
+orig_group=wheel
+new_group=wheel
+
+device_name=minipro
+
+is_target_device()
+{
+	local vendor_string
+	local product_string
+	local vendor_id
+	local product_id
+
+	#
+	# TL866A/TL866CS programmers have:
+	#
+	#	VID = 0x04d8 (1240)	# Microchip
+	#	PID = 0xe11c (57628)	# probably some PIC microcontroller
+	#
+	# XXX It's probably better to match on vendor-string / product-string
+	# in this case because of the use of the generic Microchip VID.
+	#
+	# The XGecu-branded TL866II+ devices have:
+	#
+	#	vendor-string="Xingong Electronicg Co.."
+	#	product-string="Xingong XGecu USB Prog.. Device"
+	#
+	# ...but they also have seemingly unique VID/PID (not the
+	# generic Microchip VID the older TL866A/CS programmers have):
+	#
+	#	VID = 0xa466 (42086)
+	#	PID = 0x0a53 (2643)
+	#
+	# XXX Add the XGecu T48 programmer info here.
+	#
+
+	vendor_string="$(drvctl -p $1 vendor-string)"
+	product_string="$(drvctl -p $1 product-string)"
+	vendor_id="$(drvctl -p $1 vendor-id)"
+	product_id="$(drvctl -p $1 product-id)"
+
+	#
+	# TL866A / TL866CS
+	#
+	if [ x"$vendor_id" = x"1240" -a \
+	 x"$product_id" = x"57628" ]; then
+		echo "yes"
+		return;
+	fi
+
+	#
+	# TL866II+
+	#
+	if [ x"$vendor_id" = x"42086" -a \
+	 x"$product_id" = x"2643" ]; then
+		echo "yes"
+		return
+	fi
+
+	echo "no"
+}
+
+set_permissions()
+{
+	if [ x$(is_target_device $1) = xyes ]; then
+		chgrp $new_group /dev/"${2}".*
+		chmod $new_perms /dev/"${2}".*
+		#
+		# We need to create a symlink here to remember
+		# the ugen device node that was used, since we
+		# can't recover it from the device name that
+		# comes from the kernel later because we get the
+		# event *after* the device is gone, and thus
+		# cannot query any properties.
+		#
+		rm -f /dev/${1}-${device_name}
+		ln -sf ${2} /dev/${1}-${device_name}
+	fi
+}
+
+restore_permissions()
+{
+	if [ -h "/dev/${1}-${device_name}" ]; then
+		devnode=$(readlink "/dev/${1}-${device_n

CVS commit: src

2024-03-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 30 17:12:26 UTC 2024

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_168.c platform_ilp32_int.c
platform_lp64.c queries.c
src/usr.bin/xlint/lint1: err.c init.c tree.c

Log Message:
lint: do not convert array subscripts from size_t to ptrdiff_t

The C standards do not specify a fixed type for an array subscript, it
just has to be an integer type.  Previously, query 4 fired for the
ubiquitous expression 'ptr[sz]' when sz had type 'size_t'.

The test platform_ilp32_long is unaffected by this change, as the
integer constant 0x8000 has type 'unsigned int', while size_t is
'unsigned long' on those platforms, and even though the types 'unsigned
int' and 'unsigned long' have the same value space, there's still a
conversion, at least for now.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/lint1/msg_168.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c
cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/xlint/lint1/platform_lp64.c
cvs rdiff -u -r1.24 -r1.25 src/tests/usr.bin/xlint/lint1/queries.c
cvs rdiff -u -r1.237 -r1.238 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.267 -r1.268 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.630 -r1.631 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.



CVS commit: src

2024-03-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 30 17:12:26 UTC 2024

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_168.c platform_ilp32_int.c
platform_lp64.c queries.c
src/usr.bin/xlint/lint1: err.c init.c tree.c

Log Message:
lint: do not convert array subscripts from size_t to ptrdiff_t

The C standards do not specify a fixed type for an array subscript, it
just has to be an integer type.  Previously, query 4 fired for the
ubiquitous expression 'ptr[sz]' when sz had type 'size_t'.

The test platform_ilp32_long is unaffected by this change, as the
integer constant 0x8000 has type 'unsigned int', while size_t is
'unsigned long' on those platforms, and even though the types 'unsigned
int' and 'unsigned long' have the same value space, there's still a
conversion, at least for now.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/lint1/msg_168.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c
cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/xlint/lint1/platform_lp64.c
cvs rdiff -u -r1.24 -r1.25 src/tests/usr.bin/xlint/lint1/queries.c
cvs rdiff -u -r1.237 -r1.238 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.267 -r1.268 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.630 -r1.631 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/msg_168.c
diff -u src/tests/usr.bin/xlint/lint1/msg_168.c:1.12 src/tests/usr.bin/xlint/lint1/msg_168.c:1.13
--- src/tests/usr.bin/xlint/lint1/msg_168.c:1.12	Sat Mar 30 16:47:45 2024
+++ src/tests/usr.bin/xlint/lint1/msg_168.c	Sat Mar 30 17:12:26 2024
@@ -1,7 +1,7 @@
-/*	$NetBSD: msg_168.c,v 1.12 2024/03/30 16:47:45 rillig Exp $	*/
+/*	$NetBSD: msg_168.c,v 1.13 2024/03/30 17:12:26 rillig Exp $	*/
 # 3 "msg_168.c"
 
-// Test for message: array subscript %jd cannot be > %d [168]
+// Test for message: array subscript %ju cannot be > %d [168]
 
 /* lint1-extra-flags: -X 351 */
 

Index: src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c
diff -u src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c:1.7 src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c:1.8
--- src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c:1.7	Sat Mar 30 16:47:45 2024
+++ src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c	Sat Mar 30 17:12:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: platform_ilp32_int.c,v 1.7 2024/03/30 16:47:45 rillig Exp $	*/
+/*	$NetBSD: platform_ilp32_int.c,v 1.8 2024/03/30 17:12:26 rillig Exp $	*/
 # 3 "platform_ilp32_int.c"
 
 /*
@@ -44,17 +44,13 @@ array_index(void)
 	/* expect+2: warning: conversion of 'long long' to 'int' is out of range [119] */
 	/* expect+1: warning: array subscript -2147483648 cannot be negative [167] */
 	u8 += u8_buf[2147483648];
-	/* expect+2: warning: conversion of 'unsigned int' to 'int' is out of range [119] */
-	/* expect+1: warning: array subscript -2147483648 cannot be negative [167] */
+	/* expect+1: warning: array subscript 2147483648 cannot be > 19 [168] */
 	u8 += u8_buf[0x8000];
-	/* expect+2: warning: conversion of 'unsigned int' to 'int' is out of range [119] */
-	/* expect+1: warning: array subscript -1 cannot be negative [167] */
+	/* expect+1: warning: array subscript 4294967295 cannot be > 19 [168] */
 	u8 += u8_buf[0x];
-	/* expect+2: warning: conversion of 'unsigned int' to 'int' is out of range [119] */
-	/* expect+1: warning: array subscript -2147483648 cannot be negative [167] */
+	/* expect+1: warning: array subscript 2147483648 cannot be > 19 [168] */
 	u8 += u8_buf[0x8000];
-	/* expect+2: warning: conversion of 'unsigned int' to 'int' is out of range [119] */
-	/* expect+1: warning: array subscript -1 cannot be negative [167] */
+	/* expect+1: warning: array subscript 4294967295 cannot be > 19 [168] */
 	u8 += u8_buf[0x];
 	/* expect+2: warning: conversion of 'long long' to 'int' is out of range [119] */
 	/* expect+1: warning: array subscript -1 cannot be negative [167] */
@@ -71,19 +67,15 @@ array_index(void)
 	/* expect+2: warning: '-2147483648 * 8' overflows 'int' [141] */
 	/* expect+1: warning: array subscript -268435456 cannot be negative [167] */
 	u64 += u64_buf[2147483648];
-	/* expect+3: warning: conversion of 'unsigned int' to 'int' is out of range [119] */
-	/* expect+2: warning: '-2147483648 * 8' overflows 'int' [141] */
-	/* expect+1: warning: array subscript -268435456 cannot be negative [167] */
+	/* expect+1: warning: '2147483648 * 8' overflows 'unsigned int' [141] */
 	u64 += u64_buf[0x8000];
-	/* expect+2: warning: conversion of 'unsigned int' to 'int' is out of range [119] */
-	/* expect+1: warning: array subscript -1 cannot be negative [167] */
+	/* expect+2: warning: '4294967295 * 8' overflows 'unsigned int' [141] */
+	/* expect+1: warning: array subscript 536870911 cannot be > 19 [168] */
 	u64 += u64_buf[0x];
-	/* expect+3: warning: co

CVS commit: src

2024-03-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 30 17:23:13 UTC 2024

Modified Files:
src/tests/usr.bin/xlint/lint1: queries.c t_usage.sh
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: add query for implicit integer-to-floating conversion


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/tests/usr.bin/xlint/lint1/queries.c
cvs rdiff -u -r1.18 -r1.19 src/tests/usr.bin/xlint/lint1/t_usage.sh
cvs rdiff -u -r1.238 -r1.239 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.631 -r1.632 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/queries.c
diff -u src/tests/usr.bin/xlint/lint1/queries.c:1.25 src/tests/usr.bin/xlint/lint1/queries.c:1.26
--- src/tests/usr.bin/xlint/lint1/queries.c:1.25	Sat Mar 30 17:12:26 2024
+++ src/tests/usr.bin/xlint/lint1/queries.c	Sat Mar 30 17:23:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: queries.c,v 1.25 2024/03/30 17:12:26 rillig Exp $	*/
+/*	$NetBSD: queries.c,v 1.26 2024/03/30 17:23:13 rillig Exp $	*/
 # 3 "queries.c"
 
 /*
@@ -15,7 +15,9 @@
  *	such as casts between arithmetic types.
  */
 
-/* lint1-extra-flags: -q 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 -X 351 */
+/* lint1-extra-flags: -q 1,2,3,4,5,6,7,8,9,10 */
+/* lint1-extra-flags: -q 11,12,13,14,15,16,17,18,19 */
+/* lint1-extra-flags: -X 351 */
 
 typedef unsigned char u8_t;
 typedef unsigned short u16_t;
@@ -354,9 +356,9 @@ Q9(int x)
 		return (0.0);
 	case 9:
 		return
-# 358 "queries.c" 3 4
+# 360 "queries.c" 3 4
 		((void *)0)
-# 360 "queries.c"
+# 362 "queries.c"
 		/* expect+1: warning: illegal combination of integer 'int' and pointer 'pointer to void' [183] */
 		;
 	case 10:
@@ -473,6 +475,31 @@ int Q17_wide_string[] = L" \0	";
 
 /* For Q18, see queries_schar.c and queries_uchar.c. */
 
+void
+convert_from_integer_to_floating(void)
+{
+	/* expect+1: implicit conversion from integer 'unsigned int' to floating point 'float' [Q19] */
+	f32 = 0x;
+	/* expect+1: implicit conversion from integer 'unsigned int' to floating point 'float' [Q19] */
+	f32 = 0x;
+	/* expect+1: implicit conversion from integer 'int' to floating point 'float' [Q19] */
+	f32 = s32;
+	/* expect+1: implicit conversion from integer 'unsigned int' to floating point 'float' [Q19] */
+	f32 = u32;
+	/* expect+1: implicit conversion from integer 'int' to floating point 'double' [Q19] */
+	f64 = s32;
+	/* expect+1: implicit conversion from integer 'unsigned int' to floating point 'double' [Q19] */
+	f64 = u32;
+	/* expect+1: implicit conversion from integer 'long long' to floating point 'double' [Q19] */
+	f64 = s64;
+	/* expect+1: implicit conversion from integer 'unsigned long long' to floating point 'double' [Q19] */
+	f64 = u64;
+
+	f32 = 0.0F;
+	f32 = 0.0;
+	f64 = 0.0;
+}
+
 /*
  * Since queries do not affect the exit status, force a warning to make this
  * test conform to the general expectation that a test that produces output

Index: src/tests/usr.bin/xlint/lint1/t_usage.sh
diff -u src/tests/usr.bin/xlint/lint1/t_usage.sh:1.18 src/tests/usr.bin/xlint/lint1/t_usage.sh:1.19
--- src/tests/usr.bin/xlint/lint1/t_usage.sh:1.18	Sun Mar  3 00:50:41 2024
+++ src/tests/usr.bin/xlint/lint1/t_usage.sh	Sat Mar 30 17:23:13 2024
@@ -1,4 +1,4 @@
-# $NetBSD: t_usage.sh,v 1.18 2024/03/03 00:50:41 rillig Exp $
+# $NetBSD: t_usage.sh,v 1.19 2024/03/30 17:23:13 rillig Exp $
 #
 # Copyright (c) 2023 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -89,13 +89,13 @@ enable_queries_body()
 
 	# The largest known query.
 	atf_check \
-	"$lint1" -q 18 code.c /dev/null
+	"$lint1" -q 19 code.c /dev/null
 
 	# Larger than the largest known query.
 	atf_check \
 	-s 'exit:1' \
-	-e "inline:lint1: invalid query ID '19'\n" \
-	"$lint1" -q 19 code.c /dev/null
+	-e "inline:lint1: invalid query ID '20'\n" \
+	"$lint1" -q 20 code.c /dev/null
 
 	# Whitespace is not allowed before a query ID.
 	atf_check \

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.238 src/usr.bin/xlint/lint1/err.c:1.239
--- src/usr.bin/xlint/lint1/err.c:1.238	Sat Mar 30 17:12:26 2024
+++ src/usr.bin/xlint/lint1/err.c	Sat Mar 30 17:23:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.238 2024/03/30 17:12:26 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.239 2024/03/30 17:23:13 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: err.c,v 1.238 2024/03/30 17:12:26 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.239 2024/03/30 17:23:13 rillig Exp $");
 #endif
 
 #include 
@@ -740,6 +740,7 @@ static const char *queries[] = {
 	"'%s' was declared 'static', now non-'static'",			// Q16
 	"invisible character U+%04X in %s",// Q17
 	"const automatic variable '%s'",// Q18
+	"implicit conversion from integer '%s' to floating point '%s'",	// Q19
 };
 
 bool any_query_

CVS commit: src

2024-03-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 30 17:23:13 UTC 2024

Modified Files:
src/tests/usr.bin/xlint/lint1: queries.c t_usage.sh
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: add query for implicit integer-to-floating conversion


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/tests/usr.bin/xlint/lint1/queries.c
cvs rdiff -u -r1.18 -r1.19 src/tests/usr.bin/xlint/lint1/t_usage.sh
cvs rdiff -u -r1.238 -r1.239 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.631 -r1.632 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.



CVS commit: src

2024-03-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 30 19:12:37 UTC 2024

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

Log Message:
lint: in the query about implicit conversions, ignore casts


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tests/usr.bin/xlint/lint1/queries.c
cvs rdiff -u -r1.632 -r1.633 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.



CVS commit: src

2024-03-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 30 19:12:37 UTC 2024

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

Log Message:
lint: in the query about implicit conversions, ignore casts


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tests/usr.bin/xlint/lint1/queries.c
cvs rdiff -u -r1.632 -r1.633 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/queries.c
diff -u src/tests/usr.bin/xlint/lint1/queries.c:1.26 src/tests/usr.bin/xlint/lint1/queries.c:1.27
--- src/tests/usr.bin/xlint/lint1/queries.c:1.26	Sat Mar 30 17:23:13 2024
+++ src/tests/usr.bin/xlint/lint1/queries.c	Sat Mar 30 19:12:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: queries.c,v 1.26 2024/03/30 17:23:13 rillig Exp $	*/
+/*	$NetBSD: queries.c,v 1.27 2024/03/30 19:12:37 rillig Exp $	*/
 # 3 "queries.c"
 
 /*
@@ -71,6 +71,9 @@ char *str;
 const char *cstr;
 volatile char *vstr;
 
+void *void_ptr;
+const void *const_void_ptr;
+
 int
 Q1(double dbl)
 {
@@ -356,9 +359,9 @@ Q9(int x)
 		return (0.0);
 	case 9:
 		return
-# 360 "queries.c" 3 4
+# 363 "queries.c" 3 4
 		((void *)0)
-# 362 "queries.c"
+# 365 "queries.c"
 		/* expect+1: warning: illegal combination of integer 'int' and pointer 'pointer to void' [183] */
 		;
 	case 10:
@@ -448,6 +451,9 @@ Q15(void)
 	ptr_from_uint = &ptr_from_uint;
 	ptr_from_long = &ptr_from_long;
 
+	void_ptr = (void *)0;
+	const_void_ptr = (const void *)0;
+
 	/* expect+1: implicit conversion from integer 0 to pointer 'pointer to void' [Q15] */
 	return 0;
 }
@@ -498,6 +504,9 @@ convert_from_integer_to_floating(void)
 	f32 = 0.0F;
 	f32 = 0.0;
 	f64 = 0.0;
+
+	f64 = (double)0;
+	f64 = (double)u32;
 }
 
 /*

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.632 src/usr.bin/xlint/lint1/tree.c:1.633
--- src/usr.bin/xlint/lint1/tree.c:1.632	Sat Mar 30 17:23:13 2024
+++ src/usr.bin/xlint/lint1/tree.c	Sat Mar 30 19:12:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.632 2024/03/30 17:23:13 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.633 2024/03/30 19:12:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.632 2024/03/30 17:23:13 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.633 2024/03/30 19:12:37 rillig Exp $");
 #endif
 
 #include 
@@ -3642,7 +3642,7 @@ convert(op_t op, int arg, type_t *tp, tn
 			convert_integer_from_pointer(op, nt, tp, tn);
 
 	} else if (is_floating(nt)) {
-		if (is_integer(ot)) {
+		if (is_integer(ot) && op != CVT) {
 			/* implicit conversion from integer '%s' to ... */
 			query_message(19,
 			type_name(tn->tn_type), type_name(tp));



CVS commit: src/usr.bin/calendar/calendars

2024-03-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 30 19:33:05 UTC 2024

Modified Files:
src/usr.bin/calendar/calendars: calendar.netbsd

Log Message:
Note NetBSD 10.0


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/calendar/calendars/calendar.netbsd

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



CVS commit: src/usr.bin/calendar/calendars

2024-03-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 30 19:33:05 UTC 2024

Modified Files:
src/usr.bin/calendar/calendars: calendar.netbsd

Log Message:
Note NetBSD 10.0


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/calendar/calendars/calendar.netbsd

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/calendar/calendars/calendar.netbsd
diff -u src/usr.bin/calendar/calendars/calendar.netbsd:1.49 src/usr.bin/calendar/calendars/calendar.netbsd:1.50
--- src/usr.bin/calendar/calendars/calendar.netbsd:1.49	Fri Jun  9 20:27:28 2023
+++ src/usr.bin/calendar/calendars/calendar.netbsd	Sat Mar 30 19:33:05 2024
@@ -33,6 +33,7 @@
 03/21   NetBSD/i386 port started, 1993
 03/26   NetBSD/atari port started, 1995
 03/28   NetBSD/sun2 port started, 2001
+03/28   NetBSD 10.0 released, 2024
 03/31   NetBSD 8.2 released, 2020
 04/12   NetBSD 6.0.5 released, 2014
 04/12   NetBSD 6.1.4 released, 2014



CVS commit: src/share/misc

2024-03-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 30 19:34:46 UTC 2024

Modified Files:
src/share/misc: bsd-family-tree

Log Message:
Note NetBSD 10.0


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/share/misc/bsd-family-tree

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

Modified files:

Index: src/share/misc/bsd-family-tree
diff -u src/share/misc/bsd-family-tree:1.83 src/share/misc/bsd-family-tree:1.84
--- src/share/misc/bsd-family-tree:1.83	Sun Aug  7 22:43:28 2022
+++ src/share/misc/bsd-family-tree	Sat Mar 30 19:34:46 2024
@@ -853,6 +853,7 @@ OpenBSD 7.1		2022-04-21 [OBD]
 FreeBSD 13.1		2022-05-17 [FBD]
 DragonFly 6.2.2		2022-06-09 [DFB]
 NetBSD 9.3		2022-08-04 [NBD]
+NetBSD 10.0		2024-03-28 [NBD]
 
 Bibliography
 
@@ -918,4 +919,4 @@ Copyright (c) 1997-2012 Wolfram Schneide
 URL: https://svnweb.freebsd.org/base/head/share/misc/bsd-family-tree
 
 $FreeBSD: head/share/misc/bsd-family-tree 361673 2020-05-31 21:38:33Z imp $
-$NetBSD: bsd-family-tree,v 1.83 2022/08/07 22:43:28 ast Exp $
+$NetBSD: bsd-family-tree,v 1.84 2024/03/30 19:34:46 martin Exp $



CVS commit: src/share/misc

2024-03-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 30 19:34:46 UTC 2024

Modified Files:
src/share/misc: bsd-family-tree

Log Message:
Note NetBSD 10.0


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/share/misc/bsd-family-tree

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-03-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 30 19:51:00 UTC 2024

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

Log Message:
lint: document which fields are not reset when starting a new type

Setting all visible fields to their null value seemed as if the whole
object were reset.


To generate a diff of this commit:
cvs rdiff -u -r1.397 -r1.398 src/usr.bin/xlint/lint1/decl.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/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.397 src/usr.bin/xlint/lint1/decl.c:1.398
--- src/usr.bin/xlint/lint1/decl.c:1.397	Fri Mar 29 08:35:32 2024
+++ src/usr.bin/xlint/lint1/decl.c	Sat Mar 30 19:51:00 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.397 2024/03/29 08:35:32 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.398 2024/03/30 19:51:00 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.397 2024/03/29 08:35:32 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.398 2024/03/30 19:51:00 rillig Exp $");
 #endif
 
 #include 
@@ -589,6 +589,8 @@ dcs_begin_type(void)
 {
 
 	debug_enter();
+
+	// keep d_kind
 	dcs->d_abstract_type = NO_TSPEC;
 	dcs->d_complex_mod = NO_TSPEC;
 	dcs->d_sign_mod = NO_TSPEC;
@@ -596,17 +598,24 @@ dcs_begin_type(void)
 	dcs->d_scl = NO_SCL;
 	dcs->d_type = NULL;
 	dcs->d_redeclared_symbol = NULL;
+	// keep d_sou_size_in_bits
+	// keep d_sou_align_in_bits
 	dcs->d_qual = (type_qualifiers) { .tq_const = false };
 	dcs->d_inline = false;
 	dcs->d_multiple_storage_classes = false;
 	dcs->d_invalid_type_combination = false;
 	dcs->d_nonempty_decl = false;
 	dcs->d_no_type_specifier = false;
+	// keep d_asm
 	dcs->d_packed = false;
 	dcs->d_used = false;
+	// keep d_tag_type
 	dcs->d_func_params = NULL;
 	dcs->d_func_def_pos = (pos_t){ NULL, 0, 0 };
+	// keep d_first_dlsym
+	// keep d_last_dlsym
 	dcs->d_func_proto_syms = NULL;
+	// keep d_enclosing
 }
 
 static void



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

2024-03-30 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 30 19:51:00 UTC 2024

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

Log Message:
lint: document which fields are not reset when starting a new type

Setting all visible fields to their null value seemed as if the whole
object were reset.


To generate a diff of this commit:
cvs rdiff -u -r1.397 -r1.398 src/usr.bin/xlint/lint1/decl.c

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



CVS commit: src/common/lib/libc/arch

2024-03-30 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 30 22:03:39 UTC 2024

Modified Files:
src/common/lib/libc/arch/i386/string: strlen.S
src/common/lib/libc/arch/x86_64/string: strlen.S

Log Message:
s/Westley/Wesley/ in a book reference (in comments).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/i386/string/strlen.S
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/x86_64/string/strlen.S

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



CVS commit: src/common/lib/libc/arch

2024-03-30 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 30 22:03:39 UTC 2024

Modified Files:
src/common/lib/libc/arch/i386/string: strlen.S
src/common/lib/libc/arch/x86_64/string: strlen.S

Log Message:
s/Westley/Wesley/ in a book reference (in comments).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/i386/string/strlen.S
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/x86_64/string/strlen.S

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

Modified files:

Index: src/common/lib/libc/arch/i386/string/strlen.S
diff -u src/common/lib/libc/arch/i386/string/strlen.S:1.4 src/common/lib/libc/arch/i386/string/strlen.S:1.5
--- src/common/lib/libc/arch/i386/string/strlen.S:1.4	Wed Dec  8 20:11:54 2021
+++ src/common/lib/libc/arch/i386/string/strlen.S	Sat Mar 30 22:03:39 2024
@@ -6,7 +6,7 @@
 #include 
 
 #if defined(LIBC_SCCS)
-	RCSID("$NetBSD: strlen.S,v 1.4 2021/12/08 20:11:54 andvar Exp $")
+	RCSID("$NetBSD: strlen.S,v 1.5 2024/03/30 22:03:39 andvar Exp $")
 #endif
 
 ENTRY(strlen)
@@ -89,7 +89,7 @@ ENTRY(strlen)
 	 * to load constants.
 	 *
 	 *
-	 * [1] Henry S. Warren Jr., "Hacker's Delight", Addison-Westley 2003
+	 * [1] Henry S. Warren Jr., "Hacker's Delight", Addison-Wesley 2003
 	 *
 	 * [2] International Business Machines, "The PowerPC Compiler Writer's
 	 * Guide", Warthman Associates, 1996

Index: src/common/lib/libc/arch/x86_64/string/strlen.S
diff -u src/common/lib/libc/arch/x86_64/string/strlen.S:1.7 src/common/lib/libc/arch/x86_64/string/strlen.S:1.8
--- src/common/lib/libc/arch/x86_64/string/strlen.S:1.7	Wed Dec  8 20:11:54 2021
+++ src/common/lib/libc/arch/x86_64/string/strlen.S	Sat Mar 30 22:03:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: strlen.S,v 1.7 2021/12/08 20:11:54 andvar Exp $	*/
+/*	$NetBSD: strlen.S,v 1.8 2024/03/30 22:03:39 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #include 
 
 #if defined(LIBC_SCCS)
-	RCSID("$NetBSD: strlen.S,v 1.7 2021/12/08 20:11:54 andvar Exp $")
+	RCSID("$NetBSD: strlen.S,v 1.8 2024/03/30 22:03:39 andvar Exp $")
 #endif
 
 /*
@@ -108,7 +108,7 @@
  * to load constants.
  *
  *
- * [1] Henry S. Warren Jr., "Hacker's Delight", Addison-Westley 2003
+ * [1] Henry S. Warren Jr., "Hacker's Delight", Addison-Wesley 2003
  *
  * [2] International Business Machines, "The PowerPC Compiler Writer's
  * Guide", Warthman Associates, 1996



CVS commit: src/lib/libperfuse

2024-03-30 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 30 22:05:07 UTC 2024

Modified Files:
src/lib/libperfuse: perfuse.c

Log Message:
s/Unfortunatley/Unfortunately/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/lib/libperfuse/perfuse.c

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



CVS commit: src/lib/libperfuse

2024-03-30 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 30 22:05:07 UTC 2024

Modified Files:
src/lib/libperfuse: perfuse.c

Log Message:
s/Unfortunatley/Unfortunately/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/lib/libperfuse/perfuse.c

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

Modified files:

Index: src/lib/libperfuse/perfuse.c
diff -u src/lib/libperfuse/perfuse.c:1.44 src/lib/libperfuse/perfuse.c:1.45
--- src/lib/libperfuse/perfuse.c:1.44	Wed Feb 23 21:54:40 2022
+++ src/lib/libperfuse/perfuse.c	Sat Mar 30 22:05:07 2024
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse.c,v 1.44 2022/02/23 21:54:40 andvar Exp $ */
+/*  $NetBSD: perfuse.c,v 1.45 2024/03/30 22:05:07 andvar Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -563,7 +563,7 @@ perfuse_init(struct perfuse_callbacks *p
 	 * It would be nice to avoid useless inactive, and only
 	 * get them on file open for writing (PUFFS does 
 	 * CLOSE/WRITE/INACTIVE, therefore actual close must be
-	 * done at INACTIVE time). Unfortunatley, puffs_setback
+	 * done at INACTIVE time). Unfortunately, puffs_setback
 	 * crashes when called on OPEN, therefore leave it for 
 	 * another day.
 	 */



CVS commit: src/tools

2024-03-30 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 30 22:38:03 UTC 2024

Modified Files:
src/tools: Makefile
Removed Files:
src/tools/elftoolchain: Makefile

Log Message:
tools/elftoolchain: Handle dependencies properly.

This should properly resolve the problem christos was trying to
address by a bogus make includes hack and #ifdefs in elftoolchain.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/tools/Makefile
cvs rdiff -u -r1.2 -r0 src/tools/elftoolchain/Makefile

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



CVS commit: src/tools

2024-03-30 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 30 22:38:03 UTC 2024

Modified Files:
src/tools: Makefile
Removed Files:
src/tools/elftoolchain: Makefile

Log Message:
tools/elftoolchain: Handle dependencies properly.

This should properly resolve the problem christos was trying to
address by a bogus make includes hack and #ifdefs in elftoolchain.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/tools/Makefile
cvs rdiff -u -r1.2 -r0 src/tools/elftoolchain/Makefile

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

Modified files:

Index: src/tools/Makefile
diff -u src/tools/Makefile:1.217 src/tools/Makefile:1.218
--- src/tools/Makefile:1.217	Wed Mar 27 05:43:38 2024
+++ src/tools/Makefile	Sat Mar 30 22:38:02 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.217 2024/03/27 05:43:38 rillig Exp $
+#	$NetBSD: Makefile,v 1.218 2024/03/30 22:38:02 riastradh Exp $
 
 .include 
 .include 
@@ -59,7 +59,9 @@ TOOLCHAIN_BITS+= dbsym mdsetimage
 
 DTRACE_BITS=
 .if ${MKDTRACE} != "no" || ${MKCTF} != "no"
-DTRACE_BITS+= .WAIT elftoolchain
+DTRACE_BITS+= .WAIT elftoolchain/common
+DTRACE_BITS+= .WAIT elftoolchain/libelf
+DTRACE_BITS+= .WAIT elftoolchain/libdwarf
 DTRACE_BITS+= .WAIT libctf
 .endif
 .if ${MKCTF} != "no"



CVS commit: src/tools/elftoolchain/libdwarf

2024-03-30 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 30 22:39:53 UTC 2024

Modified Files:
src/tools/elftoolchain/libdwarf: Makefile

Log Message:
tools/elftoolchain: Build with BUILTIN_ELF_HEADERS again.

The header file dependency that motivated disabling this should be
resolved now.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tools/elftoolchain/libdwarf/Makefile

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



CVS commit: src/tools/elftoolchain/libdwarf

2024-03-30 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 30 22:39:53 UTC 2024

Modified Files:
src/tools/elftoolchain/libdwarf: Makefile

Log Message:
tools/elftoolchain: Build with BUILTIN_ELF_HEADERS again.

The header file dependency that motivated disabling this should be
resolved now.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tools/elftoolchain/libdwarf/Makefile

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

Modified files:

Index: src/tools/elftoolchain/libdwarf/Makefile
diff -u src/tools/elftoolchain/libdwarf/Makefile:1.5 src/tools/elftoolchain/libdwarf/Makefile:1.6
--- src/tools/elftoolchain/libdwarf/Makefile:1.5	Wed Mar 27 21:54:43 2024
+++ src/tools/elftoolchain/libdwarf/Makefile	Sat Mar 30 22:39:53 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2024/03/27 21:54:43 christos Exp $
+#	$NetBSD: Makefile,v 1.6 2024/03/30 22:39:53 riastradh Exp $
 
 HOSTLIB=dwarf
 
@@ -73,6 +73,7 @@ COMPATLIB_NO_LIB= yes # only the include
 
 LIBDWARF_OBJDIR!= cd ${.CURDIR} && ${PRINTOBJDIR}
 
+CPPFLAGS+=	-DBUILTIN_ELF_HEADERS
 CPPFLAGS+=	-I${.CURDIR}/../../compat
 CPPFLAGS+=	-I${.CURDIR}/../../common
 CPPFLAGS+=	-I${LIBDWARF_OBJDIR}/../common



CVS commit: src/doc

2024-03-30 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Mar 31 00:06:24 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
docs/3RDPARTY: Record vendor and release tags for elftoolchain.


To generate a diff of this commit:
cvs rdiff -u -r1.2000 -r1.2001 src/doc/3RDPARTY

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



CVS commit: src/doc

2024-03-30 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Mar 31 00:06:24 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
docs/3RDPARTY: Record vendor and release tags for elftoolchain.


To generate a diff of this commit:
cvs rdiff -u -r1.2000 -r1.2001 src/doc/3RDPARTY

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.2000 src/doc/3RDPARTY:1.2001
--- src/doc/3RDPARTY:1.2000	Fri Mar 15 15:49:01 2024
+++ src/doc/3RDPARTY	Sun Mar 31 00:06:23 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.2000 2024/03/15 15:49:01 riastradh Exp $
+#	$NetBSD: 3RDPARTY,v 1.2001 2024/03/31 00:06:23 riastradh Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1648,6 +1648,8 @@ Mailing List:	none
 Responsible:	christos
 License:	BSD-like (2-clause)
 Location:	sys/external/bsd/elftoolchain/dist
+Vendor tag:	FreeBSD
+Release tag:	elftoolchain-rN
 Notes:
 		See README we use the svn id as the tag.
 



CVS commit: src

2024-03-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 31 03:20:38 UTC 2024

Modified Files:
src/external/bsd/elftoolchain/dist/libdwarf: libdwarf_reloc.c
src/tools: Makefile.nbincludes
src/tools/elftoolchain/common/sys: Makefile
Added Files:
src/tools/elftoolchain/common/sys: elfdefinitions.h

Log Message:
Restore the minimum build to install elfdefinitions.h. Provide a pre-built
copy, since we don't have m4 available. Use pax to install it because
using the Makefile needs more stuff available (nbsed) which we have not
built yet.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/elftoolchain/dist/libdwarf/libdwarf_reloc.c
cvs rdiff -u -r1.8 -r1.9 src/tools/Makefile.nbincludes
cvs rdiff -u -r1.3 -r1.4 src/tools/elftoolchain/common/sys/Makefile
cvs rdiff -u -r0 -r1.1 src/tools/elftoolchain/common/sys/elfdefinitions.h

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



CVS commit: src

2024-03-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 31 03:20:38 UTC 2024

Modified Files:
src/external/bsd/elftoolchain/dist/libdwarf: libdwarf_reloc.c
src/tools: Makefile.nbincludes
src/tools/elftoolchain/common/sys: Makefile
Added Files:
src/tools/elftoolchain/common/sys: elfdefinitions.h

Log Message:
Restore the minimum build to install elfdefinitions.h. Provide a pre-built
copy, since we don't have m4 available. Use pax to install it because
using the Makefile needs more stuff available (nbsed) which we have not
built yet.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/elftoolchain/dist/libdwarf/libdwarf_reloc.c
cvs rdiff -u -r1.8 -r1.9 src/tools/Makefile.nbincludes
cvs rdiff -u -r1.3 -r1.4 src/tools/elftoolchain/common/sys/Makefile
cvs rdiff -u -r0 -r1.1 src/tools/elftoolchain/common/sys/elfdefinitions.h

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

Modified files:

Index: src/external/bsd/elftoolchain/dist/libdwarf/libdwarf_reloc.c
diff -u src/external/bsd/elftoolchain/dist/libdwarf/libdwarf_reloc.c:1.6 src/external/bsd/elftoolchain/dist/libdwarf/libdwarf_reloc.c:1.7
--- src/external/bsd/elftoolchain/dist/libdwarf/libdwarf_reloc.c:1.6	Wed Mar 27 17:53:06 2024
+++ src/external/bsd/elftoolchain/dist/libdwarf/libdwarf_reloc.c	Sat Mar 30 23:20:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: libdwarf_reloc.c,v 1.6 2024/03/27 21:53:06 christos Exp $	*/
+/*	$NetBSD: libdwarf_reloc.c,v 1.7 2024/03/31 03:20:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 2010 Kai Wang
@@ -28,7 +28,7 @@
 
 #include "_libdwarf.h"
 
-__RCSID("$NetBSD: libdwarf_reloc.c,v 1.6 2024/03/27 21:53:06 christos Exp $");
+__RCSID("$NetBSD: libdwarf_reloc.c,v 1.7 2024/03/31 03:20:38 christos Exp $");
 ELFTC_VCSID("Id: libdwarf_reloc.c 3741 2019-06-07 06:32:01Z jkoshy");
 
 Dwarf_Unsigned
@@ -36,7 +36,7 @@ _dwarf_get_reloc_type(Dwarf_P_Debug dbg,
 {
 
 	assert(dbg != NULL);
-#ifdef BUILTIN_ELF_HEADERS
+
 	switch (dbg->dbgp_isa) {
 	case DW_ISA_AARCH64:
 		return (is64 ? R_AARCH64_ABS64 : R_AARCH64_ABS32);
@@ -59,7 +59,6 @@ _dwarf_get_reloc_type(Dwarf_P_Debug dbg,
 	default:
 		break;
 	}
-#endif
 	return (0);		/* NOT REACHED */
 }
 
@@ -67,7 +66,6 @@ int
 _dwarf_get_reloc_size(Dwarf_Debug dbg, Dwarf_Unsigned rel_type)
 {
 
-#ifdef BUILTIN_ELF_HEADERS
 	switch (dbg->dbg_machine) {
 	case EM_NONE:
 		break;
@@ -129,7 +127,6 @@ _dwarf_get_reloc_size(Dwarf_Debug dbg, D
 	default:
 		break;
 	}
-#endif
 
 	/* unknown relocation. */
 	return (0);

Index: src/tools/Makefile.nbincludes
diff -u src/tools/Makefile.nbincludes:1.8 src/tools/Makefile.nbincludes:1.9
--- src/tools/Makefile.nbincludes:1.8	Wed Mar 27 17:54:43 2024
+++ src/tools/Makefile.nbincludes	Sat Mar 30 23:20:38 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.nbincludes,v 1.8 2024/03/27 21:54:43 christos Exp $
+#	$NetBSD: Makefile.nbincludes,v 1.9 2024/03/31 03:20:38 christos Exp $
 
 .include 
 
@@ -6,6 +6,7 @@ _ARCHDIR:=	${.PARSEDIR}/../sys/arch
 _INCDIR:=	${.PARSEDIR}/../include
 _SYSDIR:=	${.PARSEDIR}/../sys/sys
 _UFSDIR:=	${.PARSEDIR}/../sys/ufs
+_ELFTOOLCHAINDIR:=	${.PARSEDIR}/elftoolchain
 _SUBDIR!=	cd ${_ARCHDIR} && ${MAKE} -V SUBDIR
 
 .if make(depend) || make(all) || make(dependall) || make(install)
@@ -45,3 +46,5 @@ beforedepend: 
 	${TOOL_PAX} -rw ${_UFS_INCS} ${TOOLDIR}/include/nbinclude/ufs
 	cd ${TOOLDIR}/include/nbinclude && rm -f machine && \
 	${HOST_INSTALL_SYMLINK} ${MACHINE} machine
+	cd ${_ELFTOOLCHAINDIR}/common/sys && \
+	${TOOL_PAX} -rw elfdefinitions.h ${TOOLDIR}/includes/sys

Index: src/tools/elftoolchain/common/sys/Makefile
diff -u src/tools/elftoolchain/common/sys/Makefile:1.3 src/tools/elftoolchain/common/sys/Makefile:1.4
--- src/tools/elftoolchain/common/sys/Makefile:1.3	Wed Mar 27 17:55:08 2024
+++ src/tools/elftoolchain/common/sys/Makefile	Sat Mar 30 23:20:38 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2024/03/27 21:55:08 christos Exp $
+#	$NetBSD: Makefile,v 1.4 2024/03/31 03:20:38 christos Exp $
 
 .include 
 
@@ -9,10 +9,11 @@ SRCDIR=	${.CURDIR}/../../../../external/
 INCS=		elfdefinitions.h
 HOST_INCSDIR=	${TOOLDIR}/include/sys
 
-elfdefinitions.h:	elfdefinitions.m4 elfconstants.m4
-	${_MKTARGET_CREATE}
-	${TOOL_M4} -I${SRCDIR} -D SRCDIR=${SRCDIR} ${M4FLAGS} \
-		elfdefinitions.m4 > ${.TARGET}
+# Too early for ${TOOL_M4}
+#elfdefinitions.h:	elfdefinitions.m4 elfconstants.m4
+#	${_MKTARGET_CREATE}
+#	${TOOL_M4} -I${SRCDIR} -D SRCDIR=${SRCDIR} ${M4FLAGS} \
+#		elfdefinitions.m4 > ${.TARGET}
 
 .PHONY:	all clean clobber depend
 
@@ -34,7 +35,7 @@ includes: .PHONY ${HOST_INCSDIR} .WAIT $
 all dependall depend:	${INCS}
 
 clean clobber:
-	rm -f ${INCS}
+#	rm -f ${INCS}
 
 cleandepend:
 	rm -f ${.OBJDIR}/.depend

Added files:

Index: src/tools/elftoolchain/common/sys/elfdefinitions.h
diff -u /dev/null src/tools/elftoolchain/common/sys/elfdefinitions.h:1.1
--- /dev/null	Sat Mar 30 23:20:38 2024
+++ src/tool