CVS commit: src/sys/arch/powerpc/ibm4xx

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Sep  5 09:57:43 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
if (cond) panic() or Debugger() in #ifdef DIAGNOSTIC ---> KASSERT(!cond)

There is no regression observed during a full ATF run.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/powerpc/ibm4xx/pmap.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/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.99 src/sys/arch/powerpc/ibm4xx/pmap.c:1.100
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.99	Sat Sep  4 14:31:04 2021
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Sun Sep  5 09:57:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.99 2021/09/04 14:31:04 rin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.100 2021/09/05 09:57:43 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.99 2021/09/04 14:31:04 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.100 2021/09/05 09:57:43 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -590,17 +590,10 @@ void
 vm_page_free1(struct vm_page *pg)
 {
 
-#ifdef DIAGNOSTIC
-	if (pg->flags != (PG_CLEAN|PG_FAKE)) {
-		printf("Freeing invalid page %p\n", pg);
-		printf("pa = %llx\n",
-		(unsigned long long)VM_PAGE_TO_PHYS(pg));
-#ifdef DDB
-		Debugger();
-#endif
-		return;
-	}
-#endif
+	KASSERTMSG(pg->flags == (PG_CLEAN | PG_FAKE),
+	"invalid page pg = %p, pa = %" PRIxPADDR,
+	pg, VM_PAGE_TO_PHYS(pg));
+
 	pg->flags |= PG_BUSY;
 	pg->wire_count = 0;
 	uvm_pagefree(pg);
@@ -824,11 +817,8 @@ pmap_enter(struct pmap *pm, vaddr_t va, 
 	/*  -- need to support multiple page sizes. */
 	tte |= TTE_SZ_16K;
 
-#ifdef DIAGNOSTIC
-	if ((flags & (PMAP_NOCACHE | PME_WRITETHROUG)) ==
-	(PMAP_NOCACHE | PME_WRITETHROUG))
-		panic("pmap_enter: uncached & writethrough");
-#endif
+	KASSERT((flags & (PMAP_NOCACHE | PME_WRITETHROUG)) !=
+	(PMAP_NOCACHE | PME_WRITETHROUG));
 
 	if (flags & PMAP_NOCACHE) {
 		/* Must be I/O mapping */
@@ -867,10 +857,7 @@ pmap_enter(struct pmap *pm, vaddr_t va, 
 
 		/* Now set attributes. */
 		attr = pa_to_attr(pa);
-#ifdef DIAGNOSTIC
-		if (!attr)
-			panic("managed but no attr");
-#endif
+		KASSERT(attr);
 		if (flags & VM_PROT_ALL)
 			*attr |= PMAP_ATTR_REF;
 		if (flags & VM_PROT_WRITE)
@@ -954,11 +941,8 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v
 		/*  -- need to support multiple page sizes. */
 		tte |= TTE_SZ_16K;
 
-#ifdef DIAGNOSTIC
-		if ((flags & (PMAP_NOCACHE | PME_WRITETHROUG)) ==
-		(PMAP_NOCACHE | PME_WRITETHROUG))
-			panic("pmap_kenter_pa: uncached & writethrough");
-#endif
+		KASSERT((flags & (PMAP_NOCACHE | PME_WRITETHROUG)) !=
+		(PMAP_NOCACHE | PME_WRITETHROUG));
 
 		if (flags & PMAP_NOCACHE)
 			/* Must be I/O mapping */
@@ -1380,11 +1364,8 @@ ppc4xx_tlb_enter(int ctx, vaddr_t va, u_
 
 	idx = ppc4xx_tlb_find_victim();
 
-#ifdef DIAGNOSTIC
-	if ((idx < tlb_nreserved) || (idx >= NTLB) || (idx & 63) == 0) {
-		panic("ppc4xx_tlb_enter: replacing entry %ld", idx);
-	}
-#endif
+	KASSERTMSG(idx >= tlb_nreserved && idx < NTLB,
+	"invalid entry %ld", idx);
 
 	tlb_info[idx].ti_va = (va & TLB_EPN_MASK);
 	tlb_info[idx].ti_ctx = ctx;
@@ -1588,22 +1569,10 @@ ctx_flush(int cnum)
 	/* We gotta steal this context */
 	for (i = tlb_nreserved; i < NTLB; i++) {
 		if (tlb_info[i].ti_ctx == cnum) {
-			/* Can't steal ctx if it has a locked entry. */
-			if (TLB_LOCKED(i)) {
-#ifdef DIAGNOSTIC
-printf("ctx_flush: can't invalidate "
-"locked mapping %d for context %d\n",
-i, cnum);
-#ifdef DDB
-Debugger();
-#endif
-#endif
-return 1;
-			}
-#ifdef DIAGNOSTIC
-			if (i < tlb_nreserved)
-panic("TLB entry %d not locked", i);
-#endif
+			/* Can't steal ctx if it has locked/reserved entry. */
+			KASSERTMSG(!TLB_LOCKED(i) && i >= tlb_nreserved,
+			"locked/reserved entry %d for ctx %d",
+			i, cnum);
 			/*
 			 * Invalidate particular TLB entry regardless of
 			 * locked status
@@ -1625,12 +1594,7 @@ ctx_alloc(struct pmap *pm)
 	static int next = MINCTX;
 	int cnum, s;
 
-	if (pm == pmap_kernel()) {
-#ifdef DIAGNOSTIC
-		printf("ctx_alloc: kernel pmap!\n");
-#endif
-		return 0;
-	}
+	KASSERT(pm != pmap_kernel());
 
 	s = splvm();
 
@@ -1682,18 +1646,9 @@ ctx_free(struct pmap *pm)
 	if (oldctx == 0)
 		panic("ctx_free: freeing kernel context");
 
-#ifdef DIAGNOSTIC
-	if (ctxbusy[oldctx] == 0)
-		printf("ctx_free: freeing free context %d\n", oldctx);
-	if (ctxbusy[oldctx] != pm) {
-		printf("ctx_free: freeing someone esle's context\n "
-		   "ctxbusy[%d] = %p, pm->pm_ctx = %p\n",
-		   oldctx, (void *)(u_long)ctxbusy[oldctx], pm);
-#ifdef DDB
-		Debugger();
-#endif
-	}
-#endif
+	KASSERTMSG(ctxbusy[oldctx] == pm,
+	"ctxbusy[%d] = %p, pm->pm_ctx = %p",
+	oldctx, ctxbusy[oldctx], pm);
 
 	/* We should verify it has not bee

CVS commit: src/sys/arch/powerpc/ibm4xx

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Sep  5 09:57:43 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
if (cond) panic() or Debugger() in #ifdef DIAGNOSTIC ---> KASSERT(!cond)

There is no regression observed during a full ATF run.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/powerpc/ibm4xx/pmap.c

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



CVS commit: src/external/cddl/osnet/sys/sys

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 10:18:31 UTC 2021

Modified Files:
src/external/cddl/osnet/sys/sys: cdefs.h

Log Message:
osnet: fix lint warning about empty declaration

proc_bkpt.c(32): warning: empty declaration [0]

Use the same definition as in libarchive.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/sys/sys/cdefs.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/cddl/osnet/sys/sys/cdefs.h
diff -u src/external/cddl/osnet/sys/sys/cdefs.h:1.1 src/external/cddl/osnet/sys/sys/cdefs.h:1.2
--- src/external/cddl/osnet/sys/sys/cdefs.h:1.1	Mon May 28 21:05:10 2018
+++ src/external/cddl/osnet/sys/sys/cdefs.h	Sun Sep  5 10:18:31 2021
@@ -1,10 +1,10 @@
-/*	$NetBSD: cdefs.h,v 1.1 2018/05/28 21:05:10 chs Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.2 2021/09/05 10:18:31 rillig Exp $	*/
 
 #ifndef _FREEBSD_SYS_CDEFS_H_
 #define _FREEBSD_SYS_CDEFS_H_
 
 #include_next 
 
-#define __FBSDID(x) /* nothing */
+#define __FBSDID(x) struct _undefined_hack
 
 #endif /* !_FREEBSD_SYS_CDEFS_H_ */



CVS commit: src/external/cddl/osnet/sys/sys

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 10:18:31 UTC 2021

Modified Files:
src/external/cddl/osnet/sys/sys: cdefs.h

Log Message:
osnet: fix lint warning about empty declaration

proc_bkpt.c(32): warning: empty declaration [0]

Use the same definition as in libarchive.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/sys/sys/cdefs.h

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



CVS commit: [netbsd-9] src/sys/arch/mips/mips

2021-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep  5 10:48:48 UTC 2021

Modified Files:
src/sys/arch/mips/mips [netbsd-9]: trap.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1342):

sys/arch/mips/mips/trap.c: revision 1.250
sys/arch/mips/mips/trap.c: revision 1.251

Add missing newline to a diagnostic printf.

Comment out the diagnostic message in the TLB_MOD handler that's logged if
pmap_tlb_update_addr() indicates that the VA+ASID was not found in the TLB.

It's a harmless race condition that can happen for legitimate reasons (e.g.
a TLB miss in an interrupt handler that evicts the entry from the TLB).

See discussion:
http://mail-index.netbsd.org/port-mips/2020/03/07/msg000927.html


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.249.4.1 src/sys/arch/mips/mips/trap.c

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



CVS commit: [netbsd-9] src/sys/arch/mips/mips

2021-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep  5 10:48:48 UTC 2021

Modified Files:
src/sys/arch/mips/mips [netbsd-9]: trap.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1342):

sys/arch/mips/mips/trap.c: revision 1.250
sys/arch/mips/mips/trap.c: revision 1.251

Add missing newline to a diagnostic printf.

Comment out the diagnostic message in the TLB_MOD handler that's logged if
pmap_tlb_update_addr() indicates that the VA+ASID was not found in the TLB.

It's a harmless race condition that can happen for legitimate reasons (e.g.
a TLB miss in an interrupt handler that evicts the entry from the TLB).

See discussion:
http://mail-index.netbsd.org/port-mips/2020/03/07/msg000927.html


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.249.4.1 src/sys/arch/mips/mips/trap.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/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.249 src/sys/arch/mips/mips/trap.c:1.249.4.1
--- src/sys/arch/mips/mips/trap.c:1.249	Sat Apr  6 11:54:20 2019
+++ src/sys/arch/mips/mips/trap.c	Sun Sep  5 10:48:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.249 2019/04/06 11:54:20 kamil Exp $	*/
+/*	$NetBSD: trap.c,v 1.249.4.1 2021/09/05 10:48:48 martin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.249 2019/04/06 11:54:20 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.249.4.1 2021/09/05 10:48:48 martin Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ddb.h"
@@ -296,10 +296,20 @@ trap(uint32_t status, uint32_t cause, va
 		vaddr = trunc_page(vaddr);
 		int ok = pmap_tlb_update_addr(pmap, vaddr, pte, 0);
 		kpreempt_enable();
-		if (ok != 1)
+		if (ok != 1) {
+#if 0 /* PMAP_FAULTINFO? */
+			/*
+			 * Since we don't block interrupts here,
+			 * this can legitimately happen if we get
+			 * a TLB miss that's serviced in an interrupt
+			 * hander that happens to randomly evict the
+			 * TLB entry we're concerned about.
+			 */
 			printf("pmap_tlb_update_addr(%p,%#"
-			PRIxVADDR",%#"PRIxPTE", 0) returned %d",
+			PRIxVADDR",%#"PRIxPTE", 0) returned %d\n",
 			pmap, vaddr, pte_value(pte), ok);
+#endif
+		}
 		paddr_t pa = pte_to_paddr(pte);
 		KASSERTMSG(uvm_pageismanaged(pa),
 		"%#"PRIxVADDR" pa %#"PRIxPADDR, vaddr, pa);



CVS commit: [netbsd-9] src/doc

2021-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep  5 10:49:51 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Ticket #1342


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.25 -r1.1.2.26 src/doc/CHANGES-9.3

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



CVS commit: [netbsd-9] src/doc

2021-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep  5 10:49:51 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Ticket #1342


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.25 -r1.1.2.26 src/doc/CHANGES-9.3

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

Modified files:

Index: src/doc/CHANGES-9.3
diff -u src/doc/CHANGES-9.3:1.1.2.25 src/doc/CHANGES-9.3:1.1.2.26
--- src/doc/CHANGES-9.3:1.1.2.25	Fri Sep  3 10:28:29 2021
+++ src/doc/CHANGES-9.3	Sun Sep  5 10:49:51 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.25 2021/09/03 10:28:29 martin Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.26 2021/09/05 10:49:51 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -622,3 +622,9 @@ sys/arch/x86/x86/pmap.c1.410
 	xen: Make pat_init() a NOOP on XENPV; it causes a trap with Xen 4.15.
 	[manu, ticket #1341]
 
+sys/arch/mips/mips/trap.c			1.250,1.251
+
+	mips: fix and disable a debug message for TLB handling.
+	[tsutsui, ticket #1342]
+
+



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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 11:42:33 UTC 2021

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

Log Message:
tests/lint: document the fixed assertion failure for struct

The change to cgram.y 1.328 from 2021-07-15 didn't fix the crash on
purpose, it was merely a side effect.  The grammar rule that probably
fixed this was that the error handling now skips to the next T_SEMI,
which it didn't do before.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/decl_struct_member.c
cvs rdiff -u -r1.9 -r1.10 \
src/tests/usr.bin/xlint/lint1/decl_struct_member.exp

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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 11:42:33 UTC 2021

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

Log Message:
tests/lint: document the fixed assertion failure for struct

The change to cgram.y 1.328 from 2021-07-15 didn't fix the crash on
purpose, it was merely a side effect.  The grammar rule that probably
fixed this was that the error handling now skips to the next T_SEMI,
which it didn't do before.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/decl_struct_member.c
cvs rdiff -u -r1.9 -r1.10 \
src/tests/usr.bin/xlint/lint1/decl_struct_member.exp

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/decl_struct_member.c
diff -u src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.11 src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.12
--- src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.11	Wed Aug 25 22:04:52 2021
+++ src/tests/usr.bin/xlint/lint1/decl_struct_member.c	Sun Sep  5 11:42:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: decl_struct_member.c,v 1.11 2021/08/25 22:04:52 rillig Exp $	*/
+/*	$NetBSD: decl_struct_member.c,v 1.12 2021/09/05 11:42:32 rillig Exp $	*/
 # 3 "decl_struct_member.c"
 
 struct multi_attributes {
@@ -77,10 +77,12 @@ struct array_of_bit_fields {
  */
 struct {
 	char a(_)0		/* expect: syntax error '0' */
-}
+
 /*
- * FIXME: adding a semicolon here triggers another assertion:
+ * Before cgram.y 1.328 from 2021-07-15, lint ran into an assertion failure
+ * at the closing semicolon:
  *
  * assertion "t == NOTSPEC" failed in end_type at decl.c:774
  */
+};
 /* expect+1: cannot recover from previous errors */

Index: src/tests/usr.bin/xlint/lint1/decl_struct_member.exp
diff -u src/tests/usr.bin/xlint/lint1/decl_struct_member.exp:1.9 src/tests/usr.bin/xlint/lint1/decl_struct_member.exp:1.10
--- src/tests/usr.bin/xlint/lint1/decl_struct_member.exp:1.9	Wed Aug 25 22:04:52 2021
+++ src/tests/usr.bin/xlint/lint1/decl_struct_member.exp	Sun Sep  5 11:42:32 2021
@@ -5,4 +5,4 @@ decl_struct_member.c(38): warning: empty
 decl_struct_member.c(47): error: syntax error 'unnamed member' [249]
 decl_struct_member.c(72): warning: illegal bit-field type 'array[8] of unsigned int' [35]
 decl_struct_member.c(79): error: syntax error '0' [249]
-decl_struct_member.c(87): error: cannot recover from previous errors [224]
+decl_struct_member.c(89): error: cannot recover from previous errors [224]



CVS commit: src/external/cddl/osnet/sys/kern

2021-09-05 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Sep  5 11:43:22 UTC 2021

Modified Files:
src/external/cddl/osnet/sys/kern: vfs.c

Log Message:
Don't use __FBSDID, similar to kern/kobj.c, kern/misc.c, kern/sysevent.c


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/cddl/osnet/sys/kern/vfs.c

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



CVS commit: src/external/cddl/osnet/sys/kern

2021-09-05 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Sep  5 11:43:22 UTC 2021

Modified Files:
src/external/cddl/osnet/sys/kern: vfs.c

Log Message:
Don't use __FBSDID, similar to kern/kobj.c, kern/misc.c, kern/sysevent.c


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/cddl/osnet/sys/kern/vfs.c

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

Modified files:

Index: src/external/cddl/osnet/sys/kern/vfs.c
diff -u src/external/cddl/osnet/sys/kern/vfs.c:1.8 src/external/cddl/osnet/sys/kern/vfs.c:1.9
--- src/external/cddl/osnet/sys/kern/vfs.c:1.8	Wed May 22 08:42:57 2019
+++ src/external/cddl/osnet/sys/kern/vfs.c	Sun Sep  5 11:43:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs.c,v 1.8 2019/05/22 08:42:57 hannken Exp $	*/
+/*	$NetBSD: vfs.c,v 1.9 2021/09/05 11:43:22 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2006-2007 Pawel Jakub Dawidek 
@@ -27,8 +27,9 @@
  */
 
 #include 
-#define __FBSDID(x)
+#ifdef __FreeBSD__
 __FBSDID("$FreeBSD: head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c 314194 2017-02-24 07:53:56Z avg $");
+#endif
 
 #include 
 #include 



CVS commit: src/sys/arch/powerpc/ibm4xx

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Sep  5 12:05:05 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
pmap_testout(): Use pmap_{protect,remove}() for va to (va + PAGE_SIZE),
instead of (va + 1).

No functional changes for the current implementation. Also, this affects
only when the function is manually called from DDB on DEBUG kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/powerpc/ibm4xx/pmap.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/powerpc/ibm4xx

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Sep  5 12:05:05 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
pmap_testout(): Use pmap_{protect,remove}() for va to (va + PAGE_SIZE),
instead of (va + 1).

No functional changes for the current implementation. Also, this affects
only when the function is manually called from DDB on DEBUG kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/powerpc/ibm4xx/pmap.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/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.100 src/sys/arch/powerpc/ibm4xx/pmap.c:1.101
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.100	Sun Sep  5 09:57:43 2021
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Sun Sep  5 12:05:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.100 2021/09/05 09:57:43 rin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.101 2021/09/05 12:05:05 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.100 2021/09/05 09:57:43 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.101 2021/09/05 12:05:05 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1732,7 +1732,7 @@ pmap_testout(void)
 	printf("Modified page: ref %d, mod %d\n", ref, mod);
 
 	/* Check pmap_protect() */
-	pmap_protect(pmap_kernel(), va, va+1, VM_PROT_READ);
+	pmap_protect(pmap_kernel(), va, va + PAGE_SIZE, VM_PROT_READ);
 	pmap_update(pmap_kernel());
 	ref = pmap_is_referenced(pg);
 	mod = pmap_is_modified(pg);
@@ -1769,7 +1769,7 @@ pmap_testout(void)
 	printf("Modified page: ref %d, mod %d\n", ref, mod);
 
 	/* Check pmap_protect() */
-	pmap_protect(pmap_kernel(), va, va+1, VM_PROT_NONE);
+	pmap_protect(pmap_kernel(), va, va + PAGE_SIZE, VM_PROT_NONE);
 	pmap_update(pmap_kernel());
 	ref = pmap_is_referenced(pg);
 	mod = pmap_is_modified(pg);
@@ -1879,7 +1879,7 @@ pmap_testout(void)
 	printf("Modified page: ref %d, mod %d\n", ref, mod);
 
 	/* Unmap page */
-	pmap_remove(pmap_kernel(), va, va+1);
+	pmap_remove(pmap_kernel(), va, va + PAGE_SIZE);
 	pmap_update(pmap_kernel());
 	ref = pmap_is_referenced(pg);
 	mod = pmap_is_modified(pg);



CVS commit: src/sys/arch/powerpc/ibm4xx

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Sep  5 12:23:40 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
pmap_enter_pv(): No need to initialize npv to NULL.

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/powerpc/ibm4xx/pmap.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/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.101 src/sys/arch/powerpc/ibm4xx/pmap.c:1.102
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.101	Sun Sep  5 12:05:05 2021
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Sun Sep  5 12:23:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.101 2021/09/05 12:05:05 rin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.102 2021/09/05 12:23:40 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.101 2021/09/05 12:05:05 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.102 2021/09/05 12:23:40 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -706,7 +706,7 @@ pmap_copy_page(paddr_t src, paddr_t dst)
 static inline int
 pmap_enter_pv(struct pmap *pm, vaddr_t va, paddr_t pa, int flags)
 {
-	struct pv_entry *pv, *npv = NULL;
+	struct pv_entry *pv, *npv;
 	int s;
 
 	if (!pmap_initialized)



CVS commit: src/sys/arch/powerpc/ibm4xx

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Sep  5 12:23:40 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
pmap_enter_pv(): No need to initialize npv to NULL.

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/powerpc/ibm4xx/pmap.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/powerpc/ibm4xx

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Sep  5 12:28:44 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
pmap_enter_pv(): At the moment, this function is always called with
pmap_initialized. So, convert test for this condition to KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/powerpc/ibm4xx/pmap.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/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.102 src/sys/arch/powerpc/ibm4xx/pmap.c:1.103
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.102	Sun Sep  5 12:23:40 2021
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Sun Sep  5 12:28:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.102 2021/09/05 12:23:40 rin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.103 2021/09/05 12:28:44 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.102 2021/09/05 12:23:40 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.103 2021/09/05 12:28:44 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -709,8 +709,7 @@ pmap_enter_pv(struct pmap *pm, vaddr_t v
 	struct pv_entry *pv, *npv;
 	int s;
 
-	if (!pmap_initialized)
-		return 0;
+	KASSERT(pmap_initialized);
 
 	s = splvm();
 



CVS commit: src/sys/arch/powerpc/ibm4xx

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Sep  5 12:28:44 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
pmap_enter_pv(): At the moment, this function is always called with
pmap_initialized. So, convert test for this condition to KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/powerpc/ibm4xx/pmap.c

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



CVS commit: src

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 12:45:44 UTC 2021

Modified Files:
src: README.md

Log Message:
README: use https for man.NetBSD.org


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/README.md

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



CVS commit: src

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 12:45:44 UTC 2021

Modified Files:
src: README.md

Log Message:
README: use https for man.NetBSD.org


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/README.md

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

Modified files:

Index: src/README.md
diff -u src/README.md:1.8 src/README.md:1.9
--- src/README.md:1.8	Sat May 29 13:08:08 2021
+++ src/README.md	Sun Sep  5 12:45:44 2021
@@ -52,5 +52,5 @@ Additional Links
 
 
 - [The NetBSD Guide](https://www.NetBSD.org/docs/guide/en/)
-- [NetBSD manual pages](http://man.NetBSD.org/)
+- [NetBSD manual pages](https://man.NetBSD.org/)
 - [NetBSD Cross-Reference](https://nxr.NetBSD.org/)



CVS commit: src/sys/arch/powerpc/ibm4xx

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Sep  5 12:47:10 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
Now, ctx_flush() never fails. So, make this function void.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/powerpc/ibm4xx/pmap.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/powerpc/ibm4xx

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Sep  5 12:47:10 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
Now, ctx_flush() never fails. So, make this function void.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/powerpc/ibm4xx/pmap.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/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.103 src/sys/arch/powerpc/ibm4xx/pmap.c:1.104
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.103	Sun Sep  5 12:28:44 2021
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Sun Sep  5 12:47:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.103 2021/09/05 12:28:44 rin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.104 2021/09/05 12:47:10 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.103 2021/09/05 12:28:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.104 2021/09/05 12:47:10 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -183,7 +183,7 @@ static struct pool pv_pool;
 
 static int pmap_initialized;
 
-static int ctx_flush(int);
+static void ctx_flush(int);
 
 struct pv_entry *pa_to_pv(paddr_t);
 static inline char *pa_to_attr(paddr_t);
@@ -1560,7 +1560,7 @@ pmap_tlbmiss(vaddr_t va, int ctx)
 /*
  * Flush all the entries matching a context from the TLB.
  */
-static int
+static void
 ctx_flush(int cnum)
 {
 	int i;
@@ -1579,7 +1579,6 @@ ctx_flush(int cnum)
 			tlb_invalidate_entry(i);
 		}
 	}
-	return 0;
 }
 
 /*
@@ -1605,15 +1604,9 @@ ctx_alloc(struct pmap *pm)
 	} while (ctxbusy[cnum] != NULL && cnum != next);
 
 	/* Now clean it out */
-oops:
 	if (cnum < MINCTX)
 		cnum = MINCTX; /* Never steal ctx 0 or 1 */
-	if (ctx_flush(cnum)) {
-		/* oops -- something's wired. */
-		if (++cnum >= NUMCTX)
-			cnum = MINCTX;
-		goto oops;
-	}
+	ctx_flush(cnum);
 
 	if (ctxbusy[cnum]) {
 #ifdef DEBUG



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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 13:19:39 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: err.c makeman

Log Message:
lint.7: document removed messages

Having just an empty string as the message was confusing.


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/xlint/lint1/makeman

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/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.142 src/usr.bin/xlint/lint1/err.c:1.143
--- src/usr.bin/xlint/lint1/err.c:1.142	Tue Aug 31 17:51:30 2021
+++ src/usr.bin/xlint/lint1/err.c	Sun Sep  5 13:19:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.142 2021/08/31 17:51:30 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.143 2021/09/05 13:19:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.142 2021/08/31 17:51:30 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.143 2021/09/05 13:19:39 rillig Exp $");
 #endif
 
 #include 
@@ -462,8 +462,12 @@ msglist(void)
 {
 	size_t i;
 
-	for (i = 0; i < sizeof(msgs) / sizeof(msgs[0]); i++)
-		printf("%zu\t%s\n", i, msgs[i]);
+	for (i = 0; i < sizeof(msgs) / sizeof(msgs[0]); i++) {
+		if (msgs[i][0] != '\0')
+			printf("%zu\t%s\n", i, msgs[i]);
+		else
+			printf("---\t(no longer used)\n");
+	}
 }
 
 /*

Index: src/usr.bin/xlint/lint1/makeman
diff -u src/usr.bin/xlint/lint1/makeman:1.3 src/usr.bin/xlint/lint1/makeman:1.4
--- src/usr.bin/xlint/lint1/makeman:1.3	Wed Apr 30 13:11:01 2008
+++ src/usr.bin/xlint/lint1/makeman	Sun Sep  5 13:19:39 2021
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: makeman,v 1.3 2008/04/30 13:11:01 martin Exp $
+#	$NetBSD: makeman,v 1.4 2021/09/05 13:19:39 rillig Exp $
 #
 # Copyright (c) 2000 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -30,7 +30,7 @@
 
 
 cat << \__EOF
-.\"	$NetBSD: makeman,v 1.3 2008/04/30 13:11:01 martin Exp $
+.\"	$NetBSD: makeman,v 1.4 2021/09/05 13:19:39 rillig Exp $
 .\"
 .\" Copyright (c) 2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -58,7 +58,7 @@ cat << \__EOF
 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
-.Dd July 5, 2000
+.Dd September 5, 2021
 .Dt LINT 7
 .Os
 .Sh NAME



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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 13:19:39 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: err.c makeman

Log Message:
lint.7: document removed messages

Having just an empty string as the message was confusing.


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/xlint/lint1/makeman

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



CVS commit: src/sys/arch/arm/fdt

2021-09-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Sep  5 13:20:34 UTC 2021

Modified Files:
src/sys/arch/arm/fdt: arm_fdt.c arm_fdtvar.h

Log Message:
Remove unused arm_fdt_memory_dump


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/fdt/arm_fdt.c \
src/sys/arch/arm/fdt/arm_fdtvar.h

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



CVS commit: src/sys/arch/arm/fdt

2021-09-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Sep  5 13:20:34 UTC 2021

Modified Files:
src/sys/arch/arm/fdt: arm_fdt.c arm_fdtvar.h

Log Message:
Remove unused arm_fdt_memory_dump


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/fdt/arm_fdt.c \
src/sys/arch/arm/fdt/arm_fdtvar.h

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/arm/fdt/arm_fdt.c
diff -u src/sys/arch/arm/fdt/arm_fdt.c:1.18 src/sys/arch/arm/fdt/arm_fdt.c:1.19
--- src/sys/arch/arm/fdt/arm_fdt.c:1.18	Mon Aug 30 23:20:00 2021
+++ src/sys/arch/arm/fdt/arm_fdt.c	Sun Sep  5 13:20:34 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: arm_fdt.c,v 1.18 2021/08/30 23:20:00 jmcneill Exp $ */
+/* $NetBSD: arm_fdt.c,v 1.19 2021/09/05 13:20:34 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -31,7 +31,7 @@
 #include "opt_modular.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.18 2021/08/30 23:20:00 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.19 2021/09/05 13:20:34 jmcneill Exp $");
 
 #include 
 #include 
@@ -227,29 +227,6 @@ arm_fdt_timer_register(void (*timerfn)(v
 	_arm_fdt_timer_init = timerfn;
 }
 
-void
-arm_fdt_memory_dump(paddr_t pa)
-{
-	const struct arm_platform *plat = arm_fdt_platform();
-	struct fdt_attach_args faa;
-	bus_space_tag_t bst;
-	bus_space_handle_t bsh;
-
-	plat->ap_init_attach_args(&faa);
-
-	bst = faa.faa_bst;
-	bus_space_map(bst, pa, 0x100, 0, &bsh);
-
-	for (int i = 0; i < 0x100; i += 0x10) {
-		printf("%" PRIxPTR ": %08x %08x %08x %08x\n",
-		(uintptr_t)(pa + i),
-		bus_space_read_4(bst, bsh, i + 0),
-		bus_space_read_4(bst, bsh, i + 4),
-		bus_space_read_4(bst, bsh, i + 8),
-		bus_space_read_4(bst, bsh, i + 12));
-	}
-}
-
 #ifdef __HAVE_GENERIC_CPU_INITCLOCKS
 void
 cpu_initclocks(void)
Index: src/sys/arch/arm/fdt/arm_fdtvar.h
diff -u src/sys/arch/arm/fdt/arm_fdtvar.h:1.18 src/sys/arch/arm/fdt/arm_fdtvar.h:1.19
--- src/sys/arch/arm/fdt/arm_fdtvar.h:1.18	Mon Aug 30 23:20:00 2021
+++ src/sys/arch/arm/fdt/arm_fdtvar.h	Sun Sep  5 13:20:34 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: arm_fdtvar.h,v 1.18 2021/08/30 23:20:00 jmcneill Exp $ */
+/* $NetBSD: arm_fdtvar.h,v 1.19 2021/09/05 13:20:34 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -97,8 +97,6 @@ void	arm_fdt_irq_handler(void *);
 void	arm_fdt_fiq_set_handler(void (*)(void *));
 void	arm_fdt_fiq_handler(void *);
 
-void	arm_fdt_memory_dump(paddr_t);
-
 void	arm_fdt_module_init(void);
 
 #endif /* !_ARM_ARM_FDTVAR_H */



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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 13:46:31 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: Makefile makeman

Log Message:
lint: generate date of lint.7 from err.c


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/xlint/lint1/makeman

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/Makefile
diff -u src/usr.bin/xlint/lint1/Makefile:1.84 src/usr.bin/xlint/lint1/Makefile:1.85
--- src/usr.bin/xlint/lint1/Makefile:1.84	Sun Aug 22 22:24:12 2021
+++ src/usr.bin/xlint/lint1/Makefile	Sun Sep  5 13:46:31 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.84 2021/08/22 22:24:12 rillig Exp $
+#	$NetBSD: Makefile,v 1.85 2021/09/05 13:46:31 rillig Exp $
 
 .include 
 
@@ -29,16 +29,34 @@ COPTS.err.c+=	${${ACTIVE_CC} == "clang":
 
 BINDIR=		/usr/libexec
 
-CLEANFILES+=	${MAN}
+CLEANFILES+=	${MAN} ${MAN}.date
 
 .if ${USETOOLS} == "yes"
 LINT1=		${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-lint1
 .endif
 LINT1?=		./${PROG}
 
-${MAN}:		makeman ${LINT1:C/^\.\///} Makefile
+${MAN}.date:	err.c
+	sed -E \
+	-e 's,.*()/([0-9]{2})/0?([0-9]+).*,\2 \3\, \1,' \
+	-e 's,^01,January,' \
+	-e 's,^02,February,' \
+	-e 's,^03,March,' \
+	-e 's,^04,April,' \
+	-e 's,^05,May,' \
+	-e 's,^06,June,' \
+	-e 's,^07,July,' \
+	-e 's,^08,August,' \
+	-e 's,^09,September,' \
+	-e 's,^10,October,' \
+	-e 's,^11,November,' \
+	-e 's,^12,December,' \
+	-e 1q \
+	${.ALLSRC} > ${.TARGET}
+
+${MAN}:		makeman ${LINT1:./%=%} Makefile ${MAN}.date
 	${_MKTARGET_CREATE}
-	${HOST_SH} ${.ALLSRC:M*makeman} ${LINT1} -m >${.TARGET}
+	${HOST_SH} ${.ALLSRC:M*makeman} "$$(cat ${.ALLSRC:M*.date})" ${LINT1} -m >${.TARGET}
 
 LDADD+=		-lm
 .ifndef HOSTPROG

Index: src/usr.bin/xlint/lint1/makeman
diff -u src/usr.bin/xlint/lint1/makeman:1.4 src/usr.bin/xlint/lint1/makeman:1.5
--- src/usr.bin/xlint/lint1/makeman:1.4	Sun Sep  5 13:19:39 2021
+++ src/usr.bin/xlint/lint1/makeman	Sun Sep  5 13:46:31 2021
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: makeman,v 1.4 2021/09/05 13:19:39 rillig Exp $
+#	$NetBSD: makeman,v 1.5 2021/09/05 13:46:31 rillig Exp $
 #
 # Copyright (c) 2000 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -29,8 +29,8 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 
-cat << \__EOF
-.\"	$NetBSD: makeman,v 1.4 2021/09/05 13:19:39 rillig Exp $
+sed "s|@date@|$1|" << \__EOF
+.\"	$NetBSD: makeman,v 1.5 2021/09/05 13:46:31 rillig Exp $
 .\"
 .\" Copyright (c) 2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -58,14 +58,14 @@ cat << \__EOF
 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
-.Dd September 5, 2021
+.Dd @date@
 .Dt LINT 7
 .Os
 .Sh NAME
 .Nm lint
 .Nd Lint error message list
 .Sh DESCRIPTION
-The following is a list of message id's and messages produced by
+The following is a list of message IDs and messages produced by
 .Xr lint 1 .
 It is intended to be used with
 .Fl X
@@ -75,6 +75,7 @@ flag of
 .Bd -ragged -offset indent -compact
 .Bl -column ""
 __EOF
+shift
 "$@" | sed -e 's/^/.It /' -e 's/\\/\\e/g' -e "s/'/\\'/"
 echo ".El"
 echo ".Ed"



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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 13:46:31 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: Makefile makeman

Log Message:
lint: generate date of lint.7 from err.c


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/xlint/lint1/makeman

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/xlint

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 15:15:58 UTC 2021

Modified Files:
src/usr.bin/xlint/xlint: Makefile

Log Message:
lint: clean up CPPFLAGS for xlint

In 1995, the file mem.c was in ../lint1.  In 2002, these files were
moved to ../common instead.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/xlint/Makefile

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/xlint

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 15:15:58 UTC 2021

Modified Files:
src/usr.bin/xlint/xlint: Makefile

Log Message:
lint: clean up CPPFLAGS for xlint

In 1995, the file mem.c was in ../lint1.  In 2002, these files were
moved to ../common instead.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/xlint/Makefile

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/xlint/Makefile
diff -u src/usr.bin/xlint/xlint/Makefile:1.22 src/usr.bin/xlint/xlint/Makefile:1.23
--- src/usr.bin/xlint/xlint/Makefile:1.22	Sun Aug 22 15:06:49 2021
+++ src/usr.bin/xlint/xlint/Makefile	Sun Sep  5 15:15:58 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.22 2021/08/22 15:06:49 rillig Exp $
+#	$NetBSD: Makefile,v 1.23 2021/09/05 15:15:58 rillig Exp $
 
 .PATH:		${.CURDIR}/../../mkdep
 
@@ -7,7 +7,6 @@ SRCS=		xlint.c mem.c findcc.c
 PROGNAME= 	lint
 MAN=		lint.1
 
-CPPFLAGS+=	-I${.CURDIR}/../lint1
 CPPFLAGS+=	-I${.CURDIR}/../../mkdep
 CPPFLAGS+=	-DIS_XLINT
 



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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 16:03:55 UTC 2021

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

Log Message:
lint: fix lint warnings


To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.377 -r1.378 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/usr.bin/xlint/lint1

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 16:03:55 UTC 2021

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

Log Message:
lint: fix lint warnings


To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.377 -r1.378 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/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.233 src/usr.bin/xlint/lint1/decl.c:1.234
--- src/usr.bin/xlint/lint1/decl.c:1.233	Sat Sep  4 13:45:37 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Sep  5 16:03:55 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.233 2021/09/04 13:45:37 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.234 2021/09/05 16:03:55 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.233 2021/09/04 13:45:37 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.234 2021/09/05 16:03:55 rillig Exp $");
 #endif
 
 #include 
@@ -907,8 +907,7 @@ length(const type_t *tp, const char *nam
 		/* FALLTHROUGH */
 	default:
 		elsz = size_in_bits(tp->t_tspec);
-		if (elsz <= 0)
-			INTERNAL_ERROR("length(%d)", elsz);
+		lint_assert(elsz > 0);
 		break;
 	}
 	return (int)(elem * elsz);
@@ -917,8 +916,8 @@ length(const type_t *tp, const char *nam
 unsigned int
 alignment_in_bits(const type_t *tp)
 {
-	size_t	a;
-	tspec_t	t;
+	unsigned int a;
+	tspec_t t;
 
 	while (tp->t_tspec == ARRAY)
 		tp = tp->t_subt;

Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.80 src/usr.bin/xlint/lint1/lex.c:1.81
--- src/usr.bin/xlint/lint1/lex.c:1.80	Sun Aug 29 09:29:32 2021
+++ src/usr.bin/xlint/lint1/lex.c	Sun Sep  5 16:03:55 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.80 2021/08/29 09:29:32 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.81 2021/09/05 16:03:55 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.80 2021/08/29 09:29:32 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.81 2021/09/05 16:03:55 rillig Exp $");
 #endif
 
 #include 
@@ -555,7 +555,7 @@ lex_integer_constant(const char *yytext,
 
 	errno = 0;
 
-	uq = strtoull(cp, &eptr, base);
+	uq = (uint64_t)strtoull(cp, &eptr, base);
 	lint_assert(eptr == cp + len);
 	if (errno != 0) {
 		/* integer constant out of range */
@@ -679,7 +679,7 @@ int
 lex_floating_constant(const char *yytext, size_t yyleng)
 {
 	const	char *cp;
-	int	len;
+	size_t	len;
 	tspec_t typ;
 	char	c, *eptr;
 	double	d;
@@ -688,10 +688,9 @@ lex_floating_constant(const char *yytext
 	cp = yytext;
 	len = yyleng;
 
-	if (cp[len - 1] == 'i') {
-		/* imaginary, do nothing for now */
-		len--;
-	}
+	if (cp[len - 1] == 'i')
+		len--;		/* imaginary, do nothing for now */
+
 	if ((c = cp[len - 1]) == 'f' || c == 'F') {
 		typ = FLOAT;
 		len--;

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.377 src/usr.bin/xlint/lint1/tree.c:1.378
--- src/usr.bin/xlint/lint1/tree.c:1.377	Sat Sep  4 12:30:46 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Sep  5 16:03:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.377 2021/09/04 12:30:46 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.378 2021/09/05 16:03:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.377 2021/09/04 12:30:46 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.378 2021/09/05 16:03:55 rillig Exp $");
 #endif
 
 #include 
@@ -311,7 +311,7 @@ build_string(strg_t *strg)
 	tp = expr_zalloc(sizeof(*tp));
 	tp->t_tspec = ARRAY;
 	tp->t_subt = gettyp(strg->st_tspec);
-	tp->t_dim = len + 1;
+	tp->t_dim = (int)(len + 1);
 
 	n->tn_op = STRING;
 	n->tn_type = tp;
@@ -1426,8 +1426,7 @@ is_first_arg_const(const tnode_t *tn)
 }
 
 static void
-check_unconst_function(const type_t *lstp,
-		   const tnode_t *rn, const type_t *rstp)
+check_unconst_function(const type_t *lstp, const tnode_t *rn)
 {
 	const char *function_name;
 
@@ -1512,7 +1511,7 @@ check_assign_void_pointer_compat(op_t op
 	}
 
 	if (!tflag)
-		check_unconst_function(lstp, rn, rstp);
+		check_unconst_function(lstp, rn);
 
 	return true;
 }
@@ -2290,7 +2289,8 @@ convert_constant_floating(op_t op, int a
 		/* Got already an error because of float --> ptr */
 	case LDOUBLE:
 	case LCOMPLEX:
-		max = LDBL_MAX;		min = -LDBL_MAX;	break;
+		/* LINTED 248 */
+		max = LDBL_MAX;		min = -max;		break;
 	default:
 		lint_assert(/*CONSTCOND*/false);
 	}
@@ -2363,7 +2363,7 @@ convert_constant_check_range_bitand(size
 const type_t *tp, op_t op)
 {
 	if (nsz > osz &&
-	(nv->v_quad & bit(osz - 1)) != 0 &&
+	(nv->v_quad & bit((

CVS commit: src/usr.bin/xlint

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 16:15:06 UTC 2021

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

Log Message:
lint: fix some more lint warnings

The only remaining warnings are in scan.c, which is a generated Flex
scanner.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.143 -r1.144 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/xlint/lint2/read.c
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/xlint/xlint/xlint.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.234 src/usr.bin/xlint/lint1/decl.c:1.235
--- src/usr.bin/xlint/lint1/decl.c:1.234	Sun Sep  5 16:03:55 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Sep  5 16:15:05 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.234 2021/09/05 16:03:55 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.235 2021/09/05 16:15:05 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.234 2021/09/05 16:03:55 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.235 2021/09/05 16:15:05 rillig Exp $");
 #endif
 
 #include 
@@ -140,6 +140,7 @@ initdecl(void)
 	typetab[LCOMPLEX].t_tspec = LCOMPLEX;
 }
 
+#ifdef DEBUG
 /* Return the name of the "storage class" in the wider sense. */
 const char *
 scl_name(scl_t scl)
@@ -153,6 +154,7 @@ scl_name(scl_t scl)
 
 	return names[scl];
 }
+#endif
 
 /*
  * Returns a shared type structure for arithmetic types and void.

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.143 src/usr.bin/xlint/lint1/err.c:1.144
--- src/usr.bin/xlint/lint1/err.c:1.143	Sun Sep  5 13:19:39 2021
+++ src/usr.bin/xlint/lint1/err.c	Sun Sep  5 16:15:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.143 2021/09/05 13:19:39 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.144 2021/09/05 16:15:05 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.143 2021/09/05 13:19:39 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.144 2021/09/05 16:15:05 rillig Exp $");
 #endif
 
 #include 
@@ -572,7 +572,7 @@ internal_error(const char *file, int lin
 	const	char *fn;
 
 	fn = lbasename(curr_pos.p_file);
-	fflush(stdout);
+	(void)fflush(stdout);
 	(void)fprintf(stderr, "lint: internal error in %s:%d near %s:%d: ",
 	file, line, fn, curr_pos.p_line);
 	va_start(ap, msg);
@@ -589,7 +589,7 @@ assert_failed(const char *file, int line
 	const	char *fn;
 
 	fn = lbasename(curr_pos.p_file);
-	fflush(stdout);
+	(void)fflush(stdout);
 	(void)fprintf(stderr,
 	"lint: assertion \"%s\" failed in %s at %s:%d near %s:%d\n",
 	cond, func, file, line, fn, curr_pos.p_line);

Index: src/usr.bin/xlint/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.64 src/usr.bin/xlint/lint2/read.c:1.65
--- src/usr.bin/xlint/lint2/read.c:1.64	Sat Sep  4 19:16:38 2021
+++ src/usr.bin/xlint/lint2/read.c	Sun Sep  5 16:15:05 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.64 2021/09/04 19:16:38 rillig Exp $ */
+/* $NetBSD: read.c,v 1.65 2021/09/05 16:15:05 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.64 2021/09/04 19:16:38 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.65 2021/09/05 16:15:05 rillig Exp $");
 #endif
 
 #include 
@@ -100,7 +100,7 @@ static	void	funccall(pos_t *, const char
 static	void	decldef(pos_t *, const char *);
 static	void	usedsym(pos_t *, const char *);
 static	unsigned short inptype(const char *, const char **);
-static	int	gettlen(const char *, const char **);
+static	size_t	gettlen(const char *, const char **);
 static	unsigned short findtype(const char *, size_t, int);
 static	unsigned short storetyp(type_t *, const char *, size_t, int);
 static	int	thash(const char *, size_t);
@@ -621,6 +621,7 @@ parse_tspec(const char **pp, char c, boo
    : (s == 'l' ? LCOMPLEX : DCOMPLEX);
 	default:
 		inperr("tspec '%c'", c);
+		/* NOTREACHED */
 	}
 }
 
@@ -730,7 +731,7 @@ inptype(const char *cp, const char **epp
 /*
  * Get the length of a type string.
  */
-static int
+static size_t
 gettlen(const char *cp, const char **epp)
 {
 	const	char *cp1;
@@ -913,7 +914,7 @@ gettlen(const char *cp, const char **epp
 	}
 
 	*epp = cp;
-	return cp - cp1;
+	return (size_t)(cp - cp1);
 }
 
 /*
@@ -1107,7 +1108,7 @@ getfnidx(const char *fn)
 	/* 0 is reserved */
 	for (i = 1; fnames[i] != NULL; i++) {
 		if (strcmp(fnames[i], fn) == 0)
-			return i;
+			return (int)i;
 	}
 
 	if (i == nfnames - 1) {
@@ -1121,7 +1122,7 @@

CVS commit: src/usr.bin/xlint

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 16:15:06 UTC 2021

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

Log Message:
lint: fix some more lint warnings

The only remaining warnings are in scan.c, which is a generated Flex
scanner.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.143 -r1.144 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/xlint/lint2/read.c
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/xlint/xlint/xlint.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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 16:36:56 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: Makefile

Log Message:
lint: suppress remaining lint warnings in generated scan.c

Warning 162 about 'unsigned <= 0' feels too ambitious, it may be
restricted to the clearly wrong 'unsigned < 0' in the future.

Warnings 192 and 214 are a result of the strict bool check, but the
error messages are suppressed, which makes it hard to see why lint says
the local variable were unused and the function would not return a
value.

Warning 307 about unused static variables is OK for generated code.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/xlint/lint1/Makefile

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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 16:36:56 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: Makefile

Log Message:
lint: suppress remaining lint warnings in generated scan.c

Warning 162 about 'unsigned <= 0' feels too ambitious, it may be
restricted to the clearly wrong 'unsigned < 0' in the future.

Warnings 192 and 214 are a result of the strict bool check, but the
error messages are suppressed, which makes it hard to see why lint says
the local variable were unused and the function would not return a
value.

Warning 307 about unused static variables is OK for generated code.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/xlint/lint1/Makefile

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/Makefile
diff -u src/usr.bin/xlint/lint1/Makefile:1.85 src/usr.bin/xlint/lint1/Makefile:1.86
--- src/usr.bin/xlint/lint1/Makefile:1.85	Sun Sep  5 13:46:31 2021
+++ src/usr.bin/xlint/lint1/Makefile	Sun Sep  5 16:36:56 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.85 2021/09/05 13:46:31 rillig Exp $
+#	$NetBSD: Makefile,v 1.86 2021/09/05 16:36:56 rillig Exp $
 
 .include 
 
@@ -20,6 +20,9 @@ LINTFLAGS+=		-T
 LOBJS.${PROG}+=		${SRCS:M*.y:.y=.ln}
 LOBJS.${PROG}+=		${SRCS:M*.l:.l=.ln}
 LINTFLAGS.scan.c+=	-X 107,126,330,331,332,333	# strict bool mode
+LINTFLAGS.scan.c+=	-X 162		# comparison of 'unsigned <= 0'
+LINTFLAGS.scan.c+=	-X 192,214	# due to suppressed bool errors
+LINTFLAGS.scan.c+=	-X 307		# static variable unused
 
 CPPFLAGS+=	-DIS_LINT1
 CPPFLAGS+=	-I${.CURDIR}



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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 16:47:24 UTC 2021

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

Log Message:
tests/lint: test comparison of 'unsigned <= 0'


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_162.c \
src/tests/usr.bin/xlint/lint1/msg_162.exp

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_162.c
diff -u src/tests/usr.bin/xlint/lint1/msg_162.c:1.4 src/tests/usr.bin/xlint/lint1/msg_162.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_162.c:1.4	Sat Aug 28 14:45:19 2021
+++ src/tests/usr.bin/xlint/lint1/msg_162.c	Sun Sep  5 16:47:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_162.c,v 1.4 2021/08/28 14:45:19 rillig Exp $	*/
+/*	$NetBSD: msg_162.c,v 1.5 2021/09/05 16:47:24 rillig Exp $	*/
 # 3 "msg_162.c"
 
 // Test for message: comparison of %s with %s, op %s [162]
@@ -82,3 +82,47 @@ compare_unsigned_char(unsigned char uc)
 	if (uc == 256)
 		return;
 }
+
+void take_bool(_Bool);
+
+void
+compare_operators(unsigned int x)
+{
+	/* expect+1: warning: comparison of unsigned int with negative constant, op < [162] */
+	take_bool(x < -1);
+	/* expect+1: warning: comparison of unsigned int with 0, op < [162] */
+	take_bool(x < 0);
+	take_bool(x < 1);
+
+	/* expect+1: warning: comparison of unsigned int with negative constant, op <= [162] */
+	take_bool(x <= -1);
+	/*
+	 * XXX: The expression 'x <= 0' is equivalent to 'x < 1', so lint
+	 * should not warn about it, just as it doesn't warn about the
+	 * inverted condition, which is 'x > 0'.
+	 */
+	/* expect+1: warning: comparison of unsigned int with 0, op <= [162] */
+	take_bool(x <= 0);
+	take_bool(x <= 1);
+
+	/* expect+1: warning: comparison of unsigned int with negative constant, op > [162] */
+	take_bool(x > -1);
+	take_bool(x > 0);
+	take_bool(x > 1);
+
+	/* expect+1: warning: comparison of unsigned int with negative constant, op >= [162] */
+	take_bool(x >= -1);
+	/* expect+1: warning: comparison of unsigned int with 0, op >= [162] */
+	take_bool(x >= 0);
+	take_bool(x >= 1);
+
+	/* expect+1: warning: comparison of unsigned int with negative constant, op == [162] */
+	take_bool(x == -1);
+	take_bool(x == 0);
+	take_bool(x == 1);
+
+	/* expect+1: warning: comparison of unsigned int with negative constant, op != [162] */
+	take_bool(x != -1);
+	take_bool(x != 0);
+	take_bool(x != 1);
+}
Index: src/tests/usr.bin/xlint/lint1/msg_162.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_162.exp:1.4 src/tests/usr.bin/xlint/lint1/msg_162.exp:1.5
--- src/tests/usr.bin/xlint/lint1/msg_162.exp:1.4	Sat Aug 28 14:45:19 2021
+++ src/tests/usr.bin/xlint/lint1/msg_162.exp	Sun Sep  5 16:47:24 2021
@@ -7,3 +7,12 @@ msg_162.c(43): warning: comparison of 0 
 msg_162.c(47): warning: comparison of 0 with unsigned int, op <= [162]
 msg_162.c(51): warning: comparison of 0 with unsigned int, op >= [162]
 msg_162.c(76): warning: comparison of unsigned char with negative constant, op == [162]
+msg_162.c(92): warning: comparison of unsigned int with negative constant, op < [162]
+msg_162.c(94): warning: comparison of unsigned int with 0, op < [162]
+msg_162.c(98): warning: comparison of unsigned int with negative constant, op <= [162]
+msg_162.c(105): warning: comparison of unsigned int with 0, op <= [162]
+msg_162.c(109): warning: comparison of unsigned int with negative constant, op > [162]
+msg_162.c(114): warning: comparison of unsigned int with negative constant, op >= [162]
+msg_162.c(116): warning: comparison of unsigned int with 0, op >= [162]
+msg_162.c(120): warning: comparison of unsigned int with negative constant, op == [162]
+msg_162.c(125): warning: comparison of unsigned int with negative constant, op != [162]



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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 16:47:24 UTC 2021

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

Log Message:
tests/lint: test comparison of 'unsigned <= 0'


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_162.c \
src/tests/usr.bin/xlint/lint1/msg_162.exp

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



CVS commit: src/share/misc

2021-09-05 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Sun Sep  5 17:29:27 UTC 2021

Modified Files:
src/share/misc: acronyms acronyms-o.real

Log Message:
Move SOB to offensive acronyms.


To generate a diff of this commit:
cvs rdiff -u -r1.310 -r1.311 src/share/misc/acronyms
cvs rdiff -u -r1.9 -r1.10 src/share/misc/acronyms-o.real

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



CVS commit: src/share/misc

2021-09-05 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Sun Sep  5 17:29:27 UTC 2021

Modified Files:
src/share/misc: acronyms acronyms-o.real

Log Message:
Move SOB to offensive acronyms.


To generate a diff of this commit:
cvs rdiff -u -r1.310 -r1.311 src/share/misc/acronyms
cvs rdiff -u -r1.9 -r1.10 src/share/misc/acronyms-o.real

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/acronyms
diff -u src/share/misc/acronyms:1.310 src/share/misc/acronyms:1.311
--- src/share/misc/acronyms:1.310	Fri Jun 18 21:58:20 2021
+++ src/share/misc/acronyms	Sun Sep  5 17:29:27 2021
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.310 2021/06/18 21:58:20 riastradh Exp $
+$NetBSD: acronyms,v 1.311 2021/09/05 17:29:27 alnsn Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -529,7 +529,6 @@ SNERT	snot-nosed egotistical rude teenag
 SNES	Super Nintendo Entertainment System
 SNMP	sorry, not my problem
 SO	significant other
-SOB	son of [a] bitch
 SOP	standard operating procedure
 SRS	serious
 SRSLY	seriously

Index: src/share/misc/acronyms-o.real
diff -u src/share/misc/acronyms-o.real:1.9 src/share/misc/acronyms-o.real:1.10
--- src/share/misc/acronyms-o.real:1.9	Sun Aug  9 17:18:47 2020
+++ src/share/misc/acronyms-o.real	Sun Sep  5 17:29:27 2021
@@ -1,4 +1,4 @@
-# $NetBSD: acronyms-o.real,v 1.9 2020/08/09 17:18:47 nia Exp $
+# $NetBSD: acronyms-o.real,v 1.10 2021/09/05 17:29:27 alnsn Exp $
 ACAB	all cops are bastards
 AFU	all fucked up
 AYFKM	are you fucking kidding me
@@ -57,6 +57,7 @@ RTFS	read the {fine,fucking} source
 SFA	sweet fuck all
 SNAFU	situation normal, all fucked up
 SNCA	shit no one cares about
+SOB	son of [a] bitch
 SOL	shit out [of] luck
 SOS	same old shit
 STFA	search the fucking archives



CVS commit: src

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 17:49:55 UTC 2021

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

Log Message:
lint: do not warn about comparison 'unsigned <= 0'

Seen in scanners generated by Flex, and about 50 occurrences in the
NetBSD src and xsrc tree, all of which are not suspicious of being bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_162.c \
src/tests/usr.bin/xlint/lint1/msg_162.exp
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.378 -r1.379 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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 17:49:55 UTC 2021

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

Log Message:
lint: do not warn about comparison 'unsigned <= 0'

Seen in scanners generated by Flex, and about 50 occurrences in the
NetBSD src and xsrc tree, all of which are not suspicious of being bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_162.c \
src/tests/usr.bin/xlint/lint1/msg_162.exp
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.378 -r1.379 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_162.c
diff -u src/tests/usr.bin/xlint/lint1/msg_162.c:1.5 src/tests/usr.bin/xlint/lint1/msg_162.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_162.c:1.5	Sun Sep  5 16:47:24 2021
+++ src/tests/usr.bin/xlint/lint1/msg_162.c	Sun Sep  5 17:49:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_162.c,v 1.5 2021/09/05 16:47:24 rillig Exp $	*/
+/*	$NetBSD: msg_162.c,v 1.6 2021/09/05 17:49:55 rillig Exp $	*/
 # 3 "msg_162.c"
 
 // Test for message: comparison of %s with %s, op %s [162]
@@ -23,7 +23,7 @@ left_unsigned(unsigned int ui)
 	if (ui >= 0) {
 	}
 
-	/* expect+1: warning: comparison of unsigned int with 0, op <= [162] */
+	/* before 2021-09-05: comparison of unsigned int with 0, op <= [162] */
 	if (ui <= 0) {
 	}
 }
@@ -47,7 +47,7 @@ right_unsigned(unsigned int ui)
 	if (0 <= ui) {
 	}
 
-	/* expect+1: warning: comparison of 0 with unsigned int, op >= [162] */
+	/* before 2021-09-05: comparison of 0 with unsigned int, op >= [162] */
 	if (0 >= ui) {
 	}
 }
@@ -97,11 +97,18 @@ compare_operators(unsigned int x)
 	/* expect+1: warning: comparison of unsigned int with negative constant, op <= [162] */
 	take_bool(x <= -1);
 	/*
-	 * XXX: The expression 'x <= 0' is equivalent to 'x < 1', so lint
-	 * should not warn about it, just as it doesn't warn about the
-	 * inverted condition, which is 'x > 0'.
+	 * Before tree.c 1.379 from 2021-09-05, lint warned about
+	 * 'unsigned <= 0' as well as '0 >= unsigned'.  In all cases where
+	 * the programmer knows whether the underlying data type is signed or
+	 * unsigned, it is clearer to express the same thought as
+	 * 'unsigned == 0', but that's a stylistic issue only.
+	 *
+	 * Removing this particular case of the warning is not expected to
+	 * miss any bugs.  The expression 'x <= 0' is equivalent to 'x < 1',
+	 * so lint should not warn about it, just as it doesn't warn about
+	 * the inverted condition, which is 'x > 0'.
 	 */
-	/* expect+1: warning: comparison of unsigned int with 0, op <= [162] */
+	/* before 2021-09-05: comparison of unsigned int with 0, op <= [162] */
 	take_bool(x <= 0);
 	take_bool(x <= 1);
 
Index: src/tests/usr.bin/xlint/lint1/msg_162.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_162.exp:1.5 src/tests/usr.bin/xlint/lint1/msg_162.exp:1.6
--- src/tests/usr.bin/xlint/lint1/msg_162.exp:1.5	Sun Sep  5 16:47:24 2021
+++ src/tests/usr.bin/xlint/lint1/msg_162.exp	Sun Sep  5 17:49:55 2021
@@ -1,18 +1,15 @@
 msg_162.c(15): warning: comparison of unsigned int with negative constant, op < [162]
 msg_162.c(19): warning: comparison of unsigned int with 0, op < [162]
 msg_162.c(23): warning: comparison of unsigned int with 0, op >= [162]
-msg_162.c(27): warning: comparison of unsigned int with 0, op <= [162]
 msg_162.c(39): warning: comparison of negative constant with unsigned int, op > [162]
 msg_162.c(43): warning: comparison of 0 with unsigned int, op > [162]
 msg_162.c(47): warning: comparison of 0 with unsigned int, op <= [162]
-msg_162.c(51): warning: comparison of 0 with unsigned int, op >= [162]
 msg_162.c(76): warning: comparison of unsigned char with negative constant, op == [162]
 msg_162.c(92): warning: comparison of unsigned int with negative constant, op < [162]
 msg_162.c(94): warning: comparison of unsigned int with 0, op < [162]
 msg_162.c(98): warning: comparison of unsigned int with negative constant, op <= [162]
-msg_162.c(105): warning: comparison of unsigned int with 0, op <= [162]
-msg_162.c(109): warning: comparison of unsigned int with negative constant, op > [162]
-msg_162.c(114): warning: comparison of unsigned int with negative constant, op >= [162]
-msg_162.c(116): warning: comparison of unsigned int with 0, op >= [162]
-msg_162.c(120): warning: comparison of unsigned int with negative constant, op == [162]
-msg_162.c(125): warning: comparison of unsigned int with negative constant, op != [162]
+msg_162.c(116): warning: comparison of unsigned int with negative constant, op > [162]
+msg_162.c(121): warning: comparison of unsigned int with negative constant, op >= [162]
+msg_162.c(123): warning: comparison of unsigned int with 0, op >= [162]
+msg_162.c(127): warning: comparison of unsigned in

CVS commit: src

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 18:17:15 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint2: t_lint2.sh
src/usr.bin/xlint/common: inittyp.c lint.h
src/usr.bin/xlint/lint2: externs2.h main2.c
src/usr.bin/xlint/xlint: xlint.c

Log Message:
lint: hide irrelevant type information from lint2

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint2/t_lint2.sh
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/xlint/common/inittyp.c
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/xlint/lint2/externs2.h
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/xlint/lint2/main2.c
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/xlint/xlint/xlint.c

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



CVS commit: src

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 18:17:15 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint2: t_lint2.sh
src/usr.bin/xlint/common: inittyp.c lint.h
src/usr.bin/xlint/lint2: externs2.h main2.c
src/usr.bin/xlint/xlint: xlint.c

Log Message:
lint: hide irrelevant type information from lint2

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint2/t_lint2.sh
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/xlint/common/inittyp.c
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/xlint/lint2/externs2.h
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/xlint/lint2/main2.c
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/xlint/xlint/xlint.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/lint2/t_lint2.sh
diff -u src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.7 src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.8
--- src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.7	Sat Sep  4 20:39:17 2021
+++ src/tests/usr.bin/xlint/lint2/t_lint2.sh	Sun Sep  5 18:17:15 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_lint2.sh,v 1.7 2021/09/04 20:39:17 rillig Exp $
+# $NetBSD: t_lint2.sh,v 1.8 2021/09/05 18:17:15 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -43,7 +43,7 @@ std_body()
 	> "$1.ln"
 
 	atf_check -o "file:$srcdir/$1.exp" \
-	"$lint2" -h -p -x "$1.ln"
+	"$lint2" -h -x "$1.ln"
 }
 
 std_emit_body()
@@ -60,7 +60,7 @@ std_emit_body()
 	> "$1.exp-ln"
 
 	atf_check \
-	"$lint2" -h -p -x -C "$1" "$1.ln"
+	"$lint2" -h -x -C "$1" "$1.ln"
 
 	atf_check -o "file:$1.exp-ln" \
 	cat "llib-l$1.ln"

Index: src/usr.bin/xlint/common/inittyp.c
diff -u src/usr.bin/xlint/common/inittyp.c:1.29 src/usr.bin/xlint/common/inittyp.c:1.30
--- src/usr.bin/xlint/common/inittyp.c:1.29	Sat Sep  4 15:39:41 2021
+++ src/usr.bin/xlint/common/inittyp.c	Sun Sep  5 18:17:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: inittyp.c,v 1.29 2021/09/04 15:39:41 rillig Exp $	*/
+/*	$NetBSD: inittyp.c,v 1.30 2021/09/05 18:17:15 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: inittyp.c,v 1.29 2021/09/04 15:39:41 rillig Exp $");
+__RCSID("$NetBSD: inittyp.c,v 1.30 2021/09/05 18:17:15 rillig Exp $");
 #endif
 
 #if defined(IS_LINT1)
@@ -48,6 +48,7 @@ __RCSID("$NetBSD: inittyp.c,v 1.29 2021/
 
 #define INT_RSIZE	(/*CONSTCOND*/INTPTR_TSPEC == LONG ? 3 : 4)
 
+#ifdef IS_LINT1
 #define typeinfo( \
 	name, signed_type, unsigned_type, \
 	size_in_bits, portable_size_in_bits, \
@@ -60,6 +61,18 @@ __RCSID("$NetBSD: inittyp.c,v 1.29 2021/
 		(is_arithmetic) > 0, (is_scalar) > 0, (is_complex) > 0, \
 		name, \
 	}
+#else
+#define typeinfo( \
+	name, signed_type, unsigned_type, \
+	size_in_bits, portable_size_in_bits, \
+	is_integer, is_unsigned, is_floating, is_arithmetic, \
+	is_scalar, is_complex) \
+	{ \
+		signed_type, unsigned_type, \
+		(is_integer) > 0, \
+		name, \
+	}
+#endif
 
 /* various type information */
 ttab_t	ttab[NTSPEC] = {
@@ -121,6 +134,7 @@ ttab_t	ttab[NTSPEC] = {
 };
 #undef typeinfo
 
+#ifdef IS_LINT1
 void
 inittyp(void)
 {
@@ -138,3 +152,4 @@ inittyp(void)
 		ttab[BOOL].tt_is_arithmetic = false;
 	}
 }
+#endif

Index: src/usr.bin/xlint/common/lint.h
diff -u src/usr.bin/xlint/common/lint.h:1.31 src/usr.bin/xlint/common/lint.h:1.32
--- src/usr.bin/xlint/common/lint.h:1.31	Sun Aug 29 09:29:32 2021
+++ src/usr.bin/xlint/common/lint.h	Sun Sep  5 18:17:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lint.h,v 1.31 2021/08/29 09:29:32 rillig Exp $	*/
+/*	$NetBSD: lint.h,v 1.32 2021/09/05 18:17:15 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -92,17 +92,21 @@ typedef enum {
  * size of types, name and classification
  */
 typedef	struct {
+#ifdef IS_LINT1
 	unsigned int tt_size_in_bits;
 	unsigned int tt_portable_size_in_bits; /* different from
 	 * tt_size_in_bits if pflag is set */
+#endif
 	tspec_t	tt_signed_counterpart;
 	tspec_t	tt_unsigned_counterpart;
 	bool	tt_is_integer : 1;	/* integer type */
+#ifdef IS_LINT1
 	bool	tt_is_uinteger : 1;	/* unsigned integer type */
 	bool	tt_is_floating : 1;	/* floating point type */
 	bool	tt_is_arithmetic : 1;	/* arithmetic type */
 	bool	tt_is_scalar : 1;	/* scalar type */
 	bool	tt_is_complex : 1;	/* complex type */
+#endif
 	const char *tt_name;		/* name of the type */
 } ttab_t;
 

Index: src/usr.bin/xlint/lint2/externs2.h
diff -u src/usr.bin/xlint/lint2/externs2.h:1.14 src/usr.bin/xlint/lint2/externs2.h:1.15
--- src/usr.bin/xlint/lint2/externs2.h:1.14	Sat Aug 28 17:18:42 2021
+++ src/usr.bin/xlint/lint2/externs2.h	Sun Sep  5 18:17:15 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: externs2.h,v 1.14 2021/08/28 17:18:42 rillig Exp $ */
+/* $NetBSD: externs2.h,v 1.15 2021/09/05 18:17:15 rillig Exp $

CVS commit: src/usr.bin/xlint

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 18:34:50 UTC 2021

Modified Files:
src/usr.bin/xlint/common: tyname.c
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: reduce number of ifdef names

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.379 -r1.380 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/usr.bin/xlint

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 18:34:50 UTC 2021

Modified Files:
src/usr.bin/xlint/common: tyname.c
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: reduce number of ifdef names

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.379 -r1.380 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/usr.bin/xlint/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.49 src/usr.bin/xlint/common/tyname.c:1.50
--- src/usr.bin/xlint/common/tyname.c:1.49	Sat Sep  4 14:07:51 2021
+++ src/usr.bin/xlint/common/tyname.c	Sun Sep  5 18:34:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.49 2021/09/04 14:07:51 rillig Exp $	*/
+/*	$NetBSD: tyname.c,v 1.50 2021/09/05 18:34:50 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tyname.c,v 1.49 2021/09/04 14:07:51 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.50 2021/09/05 18:34:50 rillig Exp $");
 #endif
 
 #include 
@@ -163,7 +163,7 @@ type_name_of_function(buffer *buf, const
 
 	buf_add(buf, "(");
 	if (tp->t_proto) {
-#ifdef t_enum /* lint1 */
+#ifdef IS_LINT1
 		sym_t *arg;
 
 		arg = tp->t_args;
@@ -173,7 +173,7 @@ type_name_of_function(buffer *buf, const
 			buf_add(buf, sep), sep = ", ";
 			buf_add(buf, type_name(arg->s_type));
 		}
-#else /* lint2 */
+#else
 		type_t **argtype;
 
 		argtype = tp->t_args;
@@ -197,7 +197,7 @@ static void
 type_name_of_struct_or_union(buffer *buf, const type_t *tp)
 {
 	buf_add(buf, " ");
-#ifdef t_str
+#ifdef IS_LINT1
 	if (tp->t_str->sou_tag->s_name == unnamed &&
 	tp->t_str->sou_first_typedef != NULL) {
 		buf_add(buf, "typedef ");
@@ -214,7 +214,7 @@ static void
 type_name_of_enum(buffer *buf, const type_t *tp)
 {
 	buf_add(buf, " ");
-#ifdef t_enum
+#ifdef IS_LINT1
 	if (tp->t_enum->en_tag->s_name == unnamed &&
 	tp->t_enum->en_first_typedef != NULL) {
 		buf_add(buf, "typedef ");
@@ -231,7 +231,7 @@ static void
 type_name_of_array(buffer *buf, const type_t *tp)
 {
 	buf_add(buf, "[");
-#ifdef t_str /* lint1 */
+#ifdef IS_LINT1
 	if (tp->t_incomplete_array)
 		buf_add(buf, "unknown_size");
 	else
@@ -263,7 +263,7 @@ type_name(const type_t *tp)
 	if (tp->t_volatile)
 		buf_add(&buf, "volatile ");
 
-#ifdef t_str
+#ifdef IS_LINT1
 	if ((t == STRUCT || t == UNION) && tp->t_str->sou_incomplete)
 		buf_add(&buf, "incomplete ");
 #endif

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.379 src/usr.bin/xlint/lint1/tree.c:1.380
--- src/usr.bin/xlint/lint1/tree.c:1.379	Sun Sep  5 17:49:55 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Sep  5 18:34:50 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.379 2021/09/05 17:49:55 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.380 2021/09/05 18:34:50 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.379 2021/09/05 17:49:55 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.380 2021/09/05 18:34:50 rillig Exp $");
 #endif
 
 #include 
@@ -4321,7 +4321,7 @@ constant_addr(const tnode_t *tn, const s
 		(!is_integer(ot) && ot != PTR)) {
 			return false;
 		}
-#ifdef notdef
+#if 0
 		/*
 		 * consider:
 		 *	struct foo {



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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 18:39:58 UTC 2021

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

Log Message:
tests/lint: clean up test for misplaced lint comments

A varargs comment that appears in the function body is already covered
by varargs_bad_body.  Cleaning up this test makes sure that the warning
is indeed triggered by the comment in the parameters declaration.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_280.c \
src/tests/usr.bin/xlint/lint1/msg_280.exp

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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 18:39:58 UTC 2021

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

Log Message:
tests/lint: clean up test for misplaced lint comments

A varargs comment that appears in the function body is already covered
by varargs_bad_body.  Cleaning up this test makes sure that the warning
is indeed triggered by the comment in the parameters declaration.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_280.c \
src/tests/usr.bin/xlint/lint1/msg_280.exp

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_280.c
diff -u src/tests/usr.bin/xlint/lint1/msg_280.c:1.3 src/tests/usr.bin/xlint/lint1/msg_280.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_280.c:1.3	Mon Aug 30 19:48:21 2021
+++ src/tests/usr.bin/xlint/lint1/msg_280.c	Sun Sep  5 18:39:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_280.c,v 1.3 2021/08/30 19:48:21 rillig Exp $	*/
+/*	$NetBSD: msg_280.c,v 1.4 2021/09/05 18:39:58 rillig Exp $	*/
 # 3 "msg_280.c"
 
 // Test for message: must be outside function: /* %s */ [280]
@@ -14,8 +14,6 @@ void
 /* XXX: Why is this comment considered 'outside' enough? */
 varargs_bad_param(/* VARARGS */ const char *str, ...)
 {
-	/* expect+1: warning: must be outside function: */
-	/* VARARGS */
 	(void)str;
 }
 
Index: src/tests/usr.bin/xlint/lint1/msg_280.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_280.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_280.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_280.exp:1.3	Mon Aug 30 19:48:21 2021
+++ src/tests/usr.bin/xlint/lint1/msg_280.exp	Sun Sep  5 18:39:58 2021
@@ -1,7 +1,6 @@
-msg_280.c(18): warning: must be outside function: /* VARARGS */ [280]
-msg_280.c(24): warning: must be outside function: /* VARARGS */ [280]
-msg_280.c(34): warning: must be outside function: /* VARARGS */ [280]
-msg_280.c(43): warning: must be outside function: /* ARGSUSED */ [280]
-msg_280.c(40): warning: argument 'str' unused in function 'argsused_bad_body' [231]
-msg_280.c(50): warning: must be outside function: /* PRINTFLIKE */ [280]
-msg_280.c(58): warning: must be outside function: /* SCANFLIKE */ [280]
+msg_280.c(22): warning: must be outside function: /* VARARGS */ [280]
+msg_280.c(32): warning: must be outside function: /* VARARGS */ [280]
+msg_280.c(41): warning: must be outside function: /* ARGSUSED */ [280]
+msg_280.c(38): warning: argument 'str' unused in function 'argsused_bad_body' [231]
+msg_280.c(48): warning: must be outside function: /* PRINTFLIKE */ [280]
+msg_280.c(56): warning: must be outside function: /* SCANFLIKE */ [280]



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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 19:16:38 UTC 2021

Modified Files:
src/tests/usr.bin/xlint: check-expect.lua
src/tests/usr.bin/xlint/lint1: msg_280.c msg_280.exp

Log Message:
tests/lint: document placement of lint comments


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/check-expect.lua
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_280.c \
src/tests/usr.bin/xlint/lint1/msg_280.exp

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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 19:16:38 UTC 2021

Modified Files:
src/tests/usr.bin/xlint: check-expect.lua
src/tests/usr.bin/xlint/lint1: msg_280.c msg_280.exp

Log Message:
tests/lint: document placement of lint comments


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/check-expect.lua
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_280.c \
src/tests/usr.bin/xlint/lint1/msg_280.exp

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/check-expect.lua
diff -u src/tests/usr.bin/xlint/check-expect.lua:1.12 src/tests/usr.bin/xlint/check-expect.lua:1.13
--- src/tests/usr.bin/xlint/check-expect.lua:1.12	Sat Aug 21 07:49:48 2021
+++ src/tests/usr.bin/xlint/check-expect.lua	Sun Sep  5 19:16:37 2021
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.12 2021/08/21 07:49:48 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.13 2021/09/05 19:16:37 rillig Exp $
 
 --[[
 
@@ -105,10 +105,11 @@ local function check_test(c_fname, error
 
   for _, act in ipairs(messages) do
 local exp = comments_by_location[act.location] or {}
+local exp_comment = act.message:gsub("/%*", "**"):gsub("%*/", "**")
 
 local found = false
 for i, message in ipairs(exp) do
-  if message ~= "" and act.message:find(message, 1, true) then
+  if message ~= "" and exp_comment:find(message, 1, true) then
 exp[i] = ""
 found = true
 break
@@ -116,7 +117,7 @@ local function check_test(c_fname, error
 end
 
 if not found then
-  errors:add("error: %s: missing /* expect+1: %s */", act.location, act.message)
+  errors:add("error: %s: missing /* expect+1: %s */", act.location, exp_comment)
 end
   end
 

Index: src/tests/usr.bin/xlint/lint1/msg_280.c
diff -u src/tests/usr.bin/xlint/lint1/msg_280.c:1.4 src/tests/usr.bin/xlint/lint1/msg_280.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_280.c:1.4	Sun Sep  5 18:39:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_280.c	Sun Sep  5 19:16:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_280.c,v 1.4 2021/09/05 18:39:58 rillig Exp $	*/
+/*	$NetBSD: msg_280.c,v 1.5 2021/09/05 19:16:37 rillig Exp $	*/
 # 3 "msg_280.c"
 
 // Test for message: must be outside function: /* %s */ [280]
@@ -10,25 +10,42 @@ varargs_ok(const char *str, ...)
 	(void)str;
 }
 
+/*
+ * In the following example, the comment looks misplaced, but lint does not
+ * warn about it.
+ *
+ * This is due to the implementation of the parser and the C grammar.  When
+ * the parser sees the token T_LPAREN, it has to decide whether the following
+ * tokens will form a parameter type list or an identifier list.  For that,
+ * it needs to look at the next token to see whether it is a T_NAME (in which
+ * case the T_LPAREN belongs to an id_list_lparen) or something else (in
+ * which case the T_LPAREN belongs to an abstract_decl_lparen).  This token
+ * lookahead happens just before either of these grammar rules is reduced.
+ * During that reduction, the current declaration context switches from
+ * 'extern' to 'prototype argument', which makes this exact position the very
+ * last possible.  Everything later would already be in the wrong context.
+ *
+ * As of cgram.y 1.360 from 2021-09-04, the implementation of these grammar
+ * rules is exactly the same, which makes it tempting to join them into a
+ * single rule.
+ */
 void
-/* XXX: Why is this comment considered 'outside' enough? */
 varargs_bad_param(/* VARARGS */ const char *str, ...)
 {
 	(void)str;
 }
 
 void
-/* expect+1: warning: must be outside function: */
+/* expect+1: warning: must be outside function: ** VARARGS ** [280] */
 varargs_bad_ellipsis(const char *str, /* VARARGS */ ...)
 {
 	(void)str;
 }
 
 void
-/* XXX: Why is this comment considered 'outside' enough? */
 varargs_bad_body(const char *str, ...)
 {
-	/* expect+1: warning: must be outside function */
+	/* expect+1: warning: must be outside function: ** VARARGS ** [280] */
 	/* VARARGS */
 	(void)str;
 }
@@ -37,14 +54,14 @@ void
 /* expect+1: warning: argument 'str' unused in function 'argsused_bad_body' [231] */
 argsused_bad_body(const char *str)
 {
-	/* expect+1: warning: must be outside function */
+	/* expect+1: warning: must be outside function: ** ARGSUSED ** [280] */
 	/* ARGSUSED */
 }
 
 void
 printflike_bad_body(const char *fmt, ...)
 {
-	/* expect+1: warning: must be outside function */
+	/* expect+1: warning: must be outside function: ** PRINTFLIKE ** [280] */
 	/* PRINTFLIKE */
 	(void)fmt;
 }
@@ -52,7 +69,7 @@ printflike_bad_body(const char *fmt, ...
 void
 scanflike_bad_body(const char *fmt, ...)
 {
-	/* expect+1: warning: must be outside function */
+	/* expect+1: warning: must be outside function: ** SCANFLIKE ** [280] */
 	/* SCANFLIKE */
 	(void)fmt;
 }
Index: src/tests/usr.bin/xlint/lint1/msg_280.exp
diff -u src/tests/usr.bin/xlint/l

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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 19:44:57 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: read.c

Log Message:
lint: extract function for reading a single line from a .ln file

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/usr.bin/xlint/lint2/read.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/lint2

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 19:44:57 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: read.c

Log Message:
lint: extract function for reading a single line from a .ln file

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/usr.bin/xlint/lint2/read.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/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.65 src/usr.bin/xlint/lint2/read.c:1.66
--- src/usr.bin/xlint/lint2/read.c:1.65	Sun Sep  5 16:15:05 2021
+++ src/usr.bin/xlint/lint2/read.c	Sun Sep  5 19:44:56 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.65 2021/09/05 16:15:05 rillig Exp $ */
+/* $NetBSD: read.c,v 1.66 2021/09/05 19:44:56 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.65 2021/09/05 16:15:05 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.66 2021/09/05 19:44:56 rillig Exp $");
 #endif
 
 #include 
@@ -139,15 +139,79 @@ parse_short(const char **p)
 	return (short)parse_int(p);
 }
 
+static void
+read_ln_line(char *line, size_t len)
+{
+	const char *cp;
+	int cline, isrc, iline;
+	char rt;
+	pos_t pos;
+
+	flines[srcfile]++;
+
+	if (len == 0 || line[len - 1] != '\n')
+		inperr("%s", &line[len - 1]);
+	line[len - 1] = '\0';
+	cp = line;
+
+	/* line number in csrcfile */
+	if (!try_parse_int(&cp, &cline))
+		cline = -1;
+
+	/* record type */
+	if (*cp == '\0')
+		inperr("missing record type");
+	rt = *cp++;
+
+	if (rt == 'S') {
+		setsrc(cp);
+		return;
+	}
+	if (rt == 's') {
+		setfnid(cline, cp);
+		return;
+	}
+
+	/*
+	 * Index of (included) source file. If this index is
+	 * different from csrcfile, it refers to an included
+	 * file.
+	 */
+	isrc = parse_int(&cp);
+	isrc = inpfns[isrc];
+
+	/* line number in isrc */
+	if (*cp++ != '.')
+		inperr("bad line number");
+	iline = parse_int(&cp);
+
+	pos.p_src = (unsigned short)csrcfile;
+	pos.p_line = (unsigned short)cline;
+	pos.p_isrc = (unsigned short)isrc;
+	pos.p_iline = (unsigned short)iline;
+
+	/* process rest of this record */
+	switch (rt) {
+	case 'c':
+		funccall(&pos, cp);
+		break;
+	case 'd':
+		decldef(&pos, cp);
+		break;
+	case 'u':
+		usedsym(&pos, cp);
+		break;
+	default:
+		inperr("bad record type %c", rt);
+	}
+}
+
 void
 readfile(const char *name)
 {
 	FILE	*inp;
 	size_t	len;
-	const	char *cp;
-	char	*line, rt = '\0';
-	int	cline, isrc, iline;
-	pos_t	pos;
+	char	*line;
 
 	if (inpfns == NULL)
 		inpfns = xcalloc(ninpfns = 128, sizeof(*inpfns));
@@ -167,65 +231,8 @@ readfile(const char *name)
 	if ((inp = fopen(name, "r")) == NULL)
 		err(1, "cannot open %s", name);
 
-	while ((line = fgetln(inp, &len)) != NULL) {
-		flines[srcfile]++;
-
-		if (len == 0 || line[len - 1] != '\n')
-			inperr("%s", &line[len - 1]);
-		line[len - 1] = '\0';
-		cp = line;
-
-		/* line number in csrcfile */
-		if (!try_parse_int(&cp, &cline))
-			cline = -1;
-
-		/* record type */
-		if (*cp == '\0')
-			inperr("missing record type");
-		rt = *cp++;
-
-		if (rt == 'S') {
-			setsrc(cp);
-			continue;
-		} else if (rt == 's') {
-			setfnid(cline, cp);
-			continue;
-		}
-
-		/*
-		 * Index of (included) source file. If this index is
-		 * different from csrcfile, it refers to an included
-		 * file.
-		 */
-		isrc = parse_int(&cp);
-		isrc = inpfns[isrc];
-
-		/* line number in isrc */
-		if (*cp++ != '.')
-			inperr("bad line number");
-		iline = parse_int(&cp);
-
-		pos.p_src = (unsigned short)csrcfile;
-		pos.p_line = (unsigned short)cline;
-		pos.p_isrc = (unsigned short)isrc;
-		pos.p_iline = (unsigned short)iline;
-
-		/* process rest of this record */
-		switch (rt) {
-		case 'c':
-			funccall(&pos, cp);
-			break;
-		case 'd':
-			decldef(&pos, cp);
-			break;
-		case 'u':
-			usedsym(&pos, cp);
-			break;
-		default:
-			inperr("bad record type %c", rt);
-		}
-
-	}
+	while ((line = fgetln(inp, &len)) != NULL)
+		read_ln_line(line, len);
 
 	_destroyhash(renametab);
 



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

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 19:58:53 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: read.c

Log Message:
lint: remove source code references from internal error message

The additional strings that are provided with the error message are
distinctive enough.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.bin/xlint/lint2/read.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/lint2

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 19:58:53 UTC 2021

Modified Files:
src/usr.bin/xlint/lint2: read.c

Log Message:
lint: remove source code references from internal error message

The additional strings that are provided with the error message are
distinctive enough.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.bin/xlint/lint2/read.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/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.66 src/usr.bin/xlint/lint2/read.c:1.67
--- src/usr.bin/xlint/lint2/read.c:1.66	Sun Sep  5 19:44:56 2021
+++ src/usr.bin/xlint/lint2/read.c	Sun Sep  5 19:58:53 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.66 2021/09/05 19:44:56 rillig Exp $ */
+/* $NetBSD: read.c,v 1.67 2021/09/05 19:58:53 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.66 2021/09/05 19:44:56 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.67 2021/09/05 19:58:53 rillig Exp $");
 #endif
 
 #include 
@@ -72,7 +72,7 @@ static	size_t	nfnames;
 /*
  * Types are shared (to save memory for the types itself) and accessed
  * via indices (to save memory for references to types (indices are short)).
- * To share types, a equal type must be located fast. This is done by a
+ * To share types, an equal type must be located fast. This is done by a
  * hash table. Access by indices is done via an array of pointers to the
  * types.
  */
@@ -91,9 +91,8 @@ static	hte_t **renametab;
 static	int	csrcfile;
 
 
-#define		inperr(fmt, args...) \
-	inperror(__FILE__, __LINE__, fmt, ##args)
-static	void	inperror(const char *, size_t, const char *, ...);
+static	void	inperr(const char *, ...)
+__attribute__((format(printf, 1, 2), noreturn));
 static	void	setsrc(const char *);
 static	void	setfnid(int, const char *);
 static	void	funccall(pos_t *, const char *);
@@ -243,8 +242,8 @@ readfile(const char *name)
 }
 
 
-static void __attribute__((format(printf, 3, 4))) __attribute__((noreturn))
-inperror(const char *file, size_t line, const char *fmt, ...)
+static void
+inperr(const char *fmt, ...)
 {
 	va_list ap;
 	char buf[1024];
@@ -253,7 +252,7 @@ inperror(const char *file, size_t line, 
 	(void)vsnprintf(buf, sizeof(buf), fmt, ap);
 	va_end(ap);
 
-	errx(1, "%s,%zu: input file error: %s,%zu (%s)", file, line,
+	errx(1, "input file error: %s,%zu (%s)",
 	fnames[srcfile], flines[srcfile], buf);
 }
 



CVS commit: src/tests/lib/libc/stdio

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 21:57:57 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: h_testnumbers.c

Log Message:
tests/stdio: on test failure, print more details

On amd64, the test stdio_intr_iofbf fails:

stdout: numbers.in...iw.ir.ir. OK
stderr: h_testnumbers: bad line 3914889

This information is not enough to get a complete picture of the
situation, so provide more details.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/stdio/h_testnumbers.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/libc/stdio

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 21:57:57 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: h_testnumbers.c

Log Message:
tests/stdio: on test failure, print more details

On amd64, the test stdio_intr_iofbf fails:

stdout: numbers.in...iw.ir.ir. OK
stderr: h_testnumbers: bad line 3914889

This information is not enough to get a complete picture of the
situation, so provide more details.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/stdio/h_testnumbers.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/libc/stdio/h_testnumbers.c
diff -u src/tests/lib/libc/stdio/h_testnumbers.c:1.1 src/tests/lib/libc/stdio/h_testnumbers.c:1.2
--- src/tests/lib/libc/stdio/h_testnumbers.c:1.1	Thu Jul  8 09:07:46 2021
+++ src/tests/lib/libc/stdio/h_testnumbers.c	Sun Sep  5 21:57:57 2021
@@ -9,7 +9,8 @@ main(void)
 	size_t i = 0;
 	while (fgets(line, sizeof(line), stdin) != NULL) {
 		if ((size_t)atoi(line) != i)
-			errx(EXIT_FAILURE, "bad line %s\n", line);
+			errx(EXIT_FAILURE, "bad line \"%s\", expected %zu\n",
+			line, i);
 		i++;
 	}
 	return EXIT_SUCCESS;



CVS commit: src/tests/lib/libc/stdio

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 22:14:49 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: t_intr.sh

Log Message:
tests/stdio: wrap test command with atf_check

Previously, the test output was:

FAILED: Test case body returned a non-ok exit code, but this is
not allowed

In many cases, the test now succeeds, but in some cases it fails:

h_testnumbers: bad line "1287185
", expected 12774

h_testnumbers: bad line "6186889
", expected 6154889


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/stdio/t_intr.sh

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



CVS commit: src/tests/lib/libc/stdio

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 22:14:49 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: t_intr.sh

Log Message:
tests/stdio: wrap test command with atf_check

Previously, the test output was:

FAILED: Test case body returned a non-ok exit code, but this is
not allowed

In many cases, the test now succeeds, but in some cases it fails:

h_testnumbers: bad line "1287185
", expected 12774

h_testnumbers: bad line "6186889
", expected 6154889


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/stdio/t_intr.sh

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/libc/stdio/t_intr.sh
diff -u src/tests/lib/libc/stdio/t_intr.sh:1.2 src/tests/lib/libc/stdio/t_intr.sh:1.3
--- src/tests/lib/libc/stdio/t_intr.sh:1.2	Fri Jul  9 15:26:59 2021
+++ src/tests/lib/libc/stdio/t_intr.sh	Sun Sep  5 22:14:49 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_intr.sh,v 1.2 2021/07/09 15:26:59 christos Exp $
+# $NetBSD: t_intr.sh,v 1.3 2021/09/05 22:14:49 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -40,7 +40,7 @@ h_test() {
 	"${DIR}/h_intr" \
 	-p "$2" -a ${SSIZE} -b ${BSIZE} -t ${TMOUT} \
 	-c "dd of=numbers.out msgfmt=quiet" numbers.in
-	"${DIR}/h_testnumbers" < numbers.out
+	atf_check "${DIR}/h_testnumbers" < numbers.out
 }
 
 atf_test_case stdio_intr_ionbf



CVS commit: src/tests/lib/libc/stdio

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 22:34:07 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: t_intr.sh

Log Message:
tests/stdio: use standard ATF tools for verifying the test output

In case of a test failure, this outputs a diff between the actual and
expected files.

Even with the smaller buffer size LMAX, the fully buffered test fails.
It does so after printing numbers up to 12773, which together take 65532
bytes.  The next number, 12774, would cross the 65536 boundary, but
instead of that number, 12710730 was written.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/stdio/t_intr.sh

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



CVS commit: src/tests/lib/libc/stdio

2021-09-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Sep  5 22:34:07 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: t_intr.sh

Log Message:
tests/stdio: use standard ATF tools for verifying the test output

In case of a test failure, this outputs a diff between the actual and
expected files.

Even with the smaller buffer size LMAX, the fully buffered test fails.
It does so after printing numbers up to 12773, which together take 65532
bytes.  The next number, 12774, would cross the 65536 boundary, but
instead of that number, 12710730 was written.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/stdio/t_intr.sh

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/libc/stdio/t_intr.sh
diff -u src/tests/lib/libc/stdio/t_intr.sh:1.3 src/tests/lib/libc/stdio/t_intr.sh:1.4
--- src/tests/lib/libc/stdio/t_intr.sh:1.3	Sun Sep  5 22:14:49 2021
+++ src/tests/lib/libc/stdio/t_intr.sh	Sun Sep  5 22:34:07 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_intr.sh,v 1.3 2021/09/05 22:14:49 rillig Exp $
+# $NetBSD: t_intr.sh,v 1.4 2021/09/05 22:34:07 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -40,7 +40,7 @@ h_test() {
 	"${DIR}/h_intr" \
 	-p "$2" -a ${SSIZE} -b ${BSIZE} -t ${TMOUT} \
 	-c "dd of=numbers.out msgfmt=quiet" numbers.in
-	atf_check "${DIR}/h_testnumbers" < numbers.out
+	atf_check -o "file:numbers.in" cat numbers.out
 }
 
 atf_test_case stdio_intr_ionbf
@@ -70,7 +70,7 @@ stdio_intr_iofbf_head()
 }
 stdio_intr_iofbf_body()
 {
-	h_test ${MAX} IOFBF
+	h_test ${LMAX} IOFBF
 }
 
 atf_init_test_cases()



CVS commit: src/sys/dev/pci

2021-09-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  6 02:43:06 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
the CPU ident and AMD both say this is "R2 Graphics", not R3.


To generate a diff of this commit:
cvs rdiff -u -r1.1432 -r1.1433 src/sys/dev/pci/pcidevs

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



CVS commit: src/sys/dev/pci

2021-09-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  6 02:43:06 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
the CPU ident and AMD both say this is "R2 Graphics", not R3.


To generate a diff of this commit:
cvs rdiff -u -r1.1432 -r1.1433 src/sys/dev/pci/pcidevs

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1432 src/sys/dev/pci/pcidevs:1.1433
--- src/sys/dev/pci/pcidevs:1.1432	Fri Sep  3 00:44:49 2021
+++ src/sys/dev/pci/pcidevs	Mon Sep  6 02:43:06 2021
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1432 2021/09/03 00:44:49 mrg Exp $
+$NetBSD: pcidevs,v 1.1433 2021/09/06 02:43:06 mrg Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2123,7 +2123,7 @@ product ATI RADEON_HD8240	0x9838	Radeon 
 product ATI RADEON_HD8180	0x9839	Radeon HD 8180
 product ATI RADEON_HD8250	0x983d	Radeon HD 8250/8280G
 product ATI RADEON_KABINI_HDA	0x9840	Kabini HDMI/DP Audio
-product ATI RADEON_R3		0x9850	Radeon R3 Graphics
+product ATI RADEON_R2_3		0x9850	Radeon R2 Graphics
 product ATI RADEON_R4R5		0x9851	Radeon R4/R5 Graphics
 product ATI RADEON_R2_1		0x9852	Radeon R2 Graphics
 product ATI RADEON_R2_2		0x9853	Radeon R2 Graphics



CVS commit: src/sys/dev/pci

2021-09-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  6 02:43:37 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1419 -r1.1420 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1418 -r1.1419 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: src/sys/dev/pci

2021-09-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  6 02:43:37 UTC 2021

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1419 -r1.1420 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1418 -r1.1419 src/sys/dev/pci/pcidevs_data.h

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

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1419 src/sys/dev/pci/pcidevs.h:1.1420
--- src/sys/dev/pci/pcidevs.h:1.1419	Fri Sep  3 00:45:33 2021
+++ src/sys/dev/pci/pcidevs.h	Mon Sep  6 02:43:36 2021
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1419 2021/09/03 00:45:33 mrg Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1420 2021/09/06 02:43:36 mrg Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1432 2021/09/03 00:44:49 mrg Exp
+ *	NetBSD: pcidevs,v 1.1433 2021/09/06 02:43:06 mrg Exp
  */
 
 /*
@@ -2130,7 +2130,7 @@
 #define	PCI_PRODUCT_ATI_RADEON_HD8180	0x9839		/* Radeon HD 8180 */
 #define	PCI_PRODUCT_ATI_RADEON_HD8250	0x983d		/* Radeon HD 8250/8280G */
 #define	PCI_PRODUCT_ATI_RADEON_KABINI_HDA	0x9840		/* Kabini HDMI/DP Audio */
-#define	PCI_PRODUCT_ATI_RADEON_R3	0x9850		/* Radeon R3 Graphics */
+#define	PCI_PRODUCT_ATI_RADEON_R2_3	0x9850		/* Radeon R2 Graphics */
 #define	PCI_PRODUCT_ATI_RADEON_R4R5	0x9851		/* Radeon R4/R5 Graphics */
 #define	PCI_PRODUCT_ATI_RADEON_R2_1	0x9852		/* Radeon R2 Graphics */
 #define	PCI_PRODUCT_ATI_RADEON_R2_2	0x9853		/* Radeon R2 Graphics */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1418 src/sys/dev/pci/pcidevs_data.h:1.1419
--- src/sys/dev/pci/pcidevs_data.h:1.1418	Fri Sep  3 00:45:33 2021
+++ src/sys/dev/pci/pcidevs_data.h	Mon Sep  6 02:43:36 2021
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1418 2021/09/03 00:45:33 mrg Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1419 2021/09/06 02:43:36 mrg Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1432 2021/09/03 00:44:49 mrg Exp
+ *	NetBSD: pcidevs,v 1.1433 2021/09/06 02:43:06 mrg Exp
  */
 
 /*
@@ -3371,14 +3371,14 @@ static const uint32_t pci_products[] = {
 	9623, 8152, 13585, 0,
 	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_KABINI_HDA, 
 	13596, 13603, 7021, 0,
-	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_R3, 
-	9623, 13533, 1716, 0,
-	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_R4R5, 
+	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_R2_3, 
 	9623, 13611, 1716, 0,
+	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_R4R5, 
+	9623, 13614, 1716, 0,
 	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_R2_1, 
-	9623, 13617, 1716, 0,
+	9623, 13611, 1716, 0,
 	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_R2_2, 
-	9623, 13617, 1716, 0,
+	9623, 13611, 1716, 0,
 	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_R2_R3_R3E_R4, 
 	9623, 13620, 0,
 	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_R6, 
@@ -3386,7 +3386,7 @@ static const uint32_t pci_products[] = {
 	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_R1ER2E, 
 	9623, 13632, 1716, 0,
 	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_XX2200MR2, 
-	9623, 13640, 13644, 13653, 13617, 1716, 0,
+	9623, 13640, 13644, 13653, 13611, 1716, 0,
 	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_R5_R6_R7, 
 	9623, 13658, 0,
 	PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_R2R3R4R5, 
@@ -10214,7 +10214,7 @@ static const uint32_t pci_products[] = {
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_XEOND_IIO_DEBUG_12, 
 	28667, 23920, 23765, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_XEOND_R2_0, 
-	28667, 13617, 8140, 23938, 0,
+	28667, 13611, 8140, 23938, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_XEOND_UBOX_0, 
 	22911, 28644, 26332, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_XEOND_UBOX_1, 
@@ -10246,7 +10246,7 @@ static const uint32_t pci_products[] = {
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_XEOND_HA0_0, 
 	28667, 23933, 23938, 8086, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_XEOND_R2_1, 
-	28667, 13617, 8140, 23938, 0,
+	28667, 13611, 8140, 23938, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_XEOND_QPI_0, 
 	28667, 23964, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_XEOND_QPI_1, 
@@ -18360,7 +18360,7 @@ static const char pci_words[] = { "." 
 	"7310\0" /* 1 refs @ 13518 */
 	"7290\0" /* 1 refs @ 13523 */
 	"8400\0" /* 2 refs @ 13528 */
-	"R3\0" /* 4 refs @ 13533 */
+	"R3\0" /* 3 refs @ 13533 */
 	"8400E\0" /* 1 refs @ 13536 */
 	"8330\0" /* 1 refs @ 13542 */
 	"8330E\0" /* 1 refs @ 13547 */
@@ -18373,8 +18373,8 @@ static const char pci_words[] = { "." 
 	"8250/8280G\0" /* 1 refs @ 13585 */
 	"Kabini\0" /* 1 refs @ 13596 */
 	"HDMI/DP\0" /* 2 refs @ 13603 */
-	"R4/R5\0" /* 1 refs @ 13611 */
-	"R2\0" /* 5 refs @ 13617 */
+	"R2\0" /* 6 refs @ 13611 */
+	"R4

CVS commit: src/lib/libcurses

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep  6 02:48:54 UTC 2021

Modified Files:
src/lib/libcurses: color.c

Log Message:
Fix old-style definition: use_default_colors() --> use_default_colors(void)


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/lib/libcurses/color.c

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



CVS commit: src/lib/libcurses

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep  6 02:48:54 UTC 2021

Modified Files:
src/lib/libcurses: color.c

Log Message:
Fix old-style definition: use_default_colors() --> use_default_colors(void)


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/lib/libcurses/color.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/libcurses/color.c
diff -u src/lib/libcurses/color.c:1.41 src/lib/libcurses/color.c:1.42
--- src/lib/libcurses/color.c:1.41	Fri Jan  6 13:53:18 2017
+++ src/lib/libcurses/color.c	Mon Sep  6 02:48:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: color.c,v 1.41 2017/01/06 13:53:18 roy Exp $	*/
+/*	$NetBSD: color.c,v 1.42 2021/09/06 02:48:54 rin Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: color.c,v 1.41 2017/01/06 13:53:18 roy Exp $");
+__RCSID("$NetBSD: color.c,v 1.42 2021/09/06 02:48:54 rin Exp $");
 #endif/* not lint */
 
 #include "curses.h"
@@ -439,7 +439,7 @@ color_content(short color, short *redp, 
  *	Use terminal default colours instead of curses default colour.
   */
 int
-use_default_colors()
+use_default_colors(void)
 {
 #ifdef DEBUG
 	__CTRACE(__CTRACE_COLOR, "use_default_colors\n");



CVS commit: src/lib/libcurses

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep  6 02:50:43 UTC 2021

Modified Files:
src/lib/libcurses: version.c

Log Message:
Fix old-style definition: curses_version() --> curses_version(void)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libcurses/version.c

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



CVS commit: src/lib/libcurses

2021-09-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep  6 02:50:43 UTC 2021

Modified Files:
src/lib/libcurses: version.c

Log Message:
Fix old-style definition: curses_version() --> curses_version(void)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libcurses/version.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/libcurses/version.c
diff -u src/lib/libcurses/version.c:1.3 src/lib/libcurses/version.c:1.4
--- src/lib/libcurses/version.c:1.3	Tue Sep  3 13:43:34 2019
+++ src/lib/libcurses/version.c	Mon Sep  6 02:50:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: version.c,v 1.3 2019/09/03 13:43:34 roy Exp $	*/
+/*	$NetBSD: version.c,v 1.4 2021/09/06 02:50:43 rin Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: version.c,v 1.3 2019/09/03 13:43:34 roy Exp $");
+__RCSID("$NetBSD: version.c,v 1.4 2021/09/06 02:50:43 rin Exp $");
 #endif
 
 #include "curses.h"
@@ -59,7 +59,7 @@ __RCSID("$NetBSD: version.c,v 1.3 2019/0
 #endif
 
 const char *
-curses_version()
+curses_version(void)
 {
 
 	return "NetBSD-Curses" _CURSES_VERSION;