CVS commit: src/share/man/man4/man4.i386

2021-02-27 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Feb 28 07:51:29 UTC 2021

Modified Files:
src/share/man/man4/man4.i386: intro.4

Log Message:
Add SEE ALSOs for various bus types

suggested by mrg


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/share/man/man4/man4.i386/intro.4

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



CVS commit: src/share/man/man4/man4.i386

2021-02-27 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Feb 28 07:51:29 UTC 2021

Modified Files:
src/share/man/man4/man4.i386: intro.4

Log Message:
Add SEE ALSOs for various bus types

suggested by mrg


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/share/man/man4/man4.i386/intro.4

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

Modified files:

Index: src/share/man/man4/man4.i386/intro.4
diff -u src/share/man/man4/man4.i386/intro.4:1.32 src/share/man/man4/man4.i386/intro.4:1.33
--- src/share/man/man4/man4.i386/intro.4:1.32	Fri Feb 26 10:56:48 2021
+++ src/share/man/man4/man4.i386/intro.4	Sun Feb 28 07:51:29 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: intro.4,v 1.32 2021/02/26 10:56:48 nia Exp $
+.\" $NetBSD: intro.4,v 1.33 2021/02/28 07:51:29 nia Exp $
 .\"
 .\" Copyright (c) 1997 Jonathan Stone
 .\" Copyright (c) 1994 Christopher G. Demetriou
@@ -166,8 +166,18 @@ console driver.
 .\"
 .Sh SEE ALSO
 .Xr config 1 ,
+.Xr com 4 ,
+.Xr eisa 4 ,
 .Xr i386/autoconf 4 ,
-.Xr netintro 4
+.Xr isa 4 ,
+.Xr isapnp 4 ,
+.Xr mca 4 ,
+.Xr netintro 4 ,
+.Xr pci 4 ,
+.Xr speaker 4 ,
+.Xr x86/fdc 4 ,
+.Xr x86/lpt 4 ,
+.Xr x86/mem 4
 .Sh HISTORY
 The
 .Tn i386



CVS commit: [netbsd-9] src/doc

2021-02-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Feb 28 07:09:00 UTC 2021

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

Log Message:
Tickets #1216 - #1218


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.51 -r1.1.2.52 src/doc/CHANGES-9.2

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.2
diff -u src/doc/CHANGES-9.2:1.1.2.51 src/doc/CHANGES-9.2:1.1.2.52
--- src/doc/CHANGES-9.2:1.1.2.51	Fri Feb 26 13:31:21 2021
+++ src/doc/CHANGES-9.2	Sun Feb 28 07:09:00 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.2,v 1.1.2.51 2021/02/26 13:31:21 martin Exp $
+# $NetBSD: CHANGES-9.2,v 1.1.2.52 2021/02/28 07:09:00 martin Exp $
 
 A complete list of changes from the NetBSD 9.1 release to the NetBSD 9.2
 release:
@@ -1711,3 +1711,18 @@ usr.bin/patch/patch.c1.30
 	patch(1): make '-V none' work.
 	[nia, ticket #1215]
 
+sys/arch/hppa/gsc/harmony.c			1.8-1.10
+
+	harmony(4): fix locking bug and handling of channel/speed bits.
+	[isaki, ticket #1216]
+
+sys/dev/audio/audio.c1.46,1.82,1.85,1.87,1.88
+
+	audio(4): comments and diagnostics improvements.
+	[isaki, ticket #1217]
+
+sys/dev/audio/audio.c1.84
+
+	Fix return value of audiopoll().
+	[isaki, ticket #1218]
+



CVS commit: [netbsd-9] src/doc

2021-02-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Feb 28 07:09:00 UTC 2021

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

Log Message:
Tickets #1216 - #1218


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.51 -r1.1.2.52 src/doc/CHANGES-9.2

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/dev/audio

2021-02-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Feb 28 07:07:38 UTC 2021

Modified Files:
src/sys/dev/audio [netbsd-9]: audio.c

Log Message:
Pull up following revision(s) (requested by isaki in ticket #1218):

sys/dev/audio/audio.c: revision 1.84

Fix a return value of audiopoll().
fo_poll is expected to return revents rather than errno on error.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.19 -r1.28.2.20 src/sys/dev/audio/audio.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/dev/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.28.2.19 src/sys/dev/audio/audio.c:1.28.2.20
--- src/sys/dev/audio/audio.c:1.28.2.19	Sun Feb 28 07:05:14 2021
+++ src/sys/dev/audio/audio.c	Sun Feb 28 07:07:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.28.2.19 2021/02/28 07:05:14 martin Exp $	*/
+/*	$NetBSD: audio.c,v 1.28.2.20 2021/02/28 07:07:38 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -138,7 +138,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.28.2.19 2021/02/28 07:05:14 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.28.2.20 2021/02/28 07:07:38 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -1885,7 +1885,7 @@ audiopoll(struct file *fp, int events)
 
 	sc = audio_file_enter(file, _ref);
 	if (sc == NULL)
-		return EIO;
+		return POLLERR;
 
 	switch (AUDIODEV(dev)) {
 	case SOUND_DEVICE:



CVS commit: [netbsd-9] src/sys/dev/audio

2021-02-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Feb 28 07:07:38 UTC 2021

Modified Files:
src/sys/dev/audio [netbsd-9]: audio.c

Log Message:
Pull up following revision(s) (requested by isaki in ticket #1218):

sys/dev/audio/audio.c: revision 1.84

Fix a return value of audiopoll().
fo_poll is expected to return revents rather than errno on error.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.19 -r1.28.2.20 src/sys/dev/audio/audio.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/dev/audio

2021-02-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Feb 28 07:05:14 UTC 2021

Modified Files:
src/sys/dev/audio [netbsd-9]: audio.c

Log Message:
Pull up following revision(s) (requested by isaki in ticket #1217):

sys/dev/audio/audio.c: revision 1.46
sys/dev/audio/audio.c: revision 1.82
sys/dev/audio/audio.c: revision 1.85
sys/dev/audio/audio.c: revision 1.87
sys/dev/audio/audio.c: revision 1.88

Change two aprint_error_dev() to device_printf() (and improve messages).
This is also called from other than boot.

Add missing newline.

Revise comments.

Change (harmless) zero-length debug messages.
sys/modules is compiled with -Wzero-length-format and this
makes sys/modules compilable even if AUDIO_DEBUG is defined.

Improve error messages.
- prefix MD device name if it's considered to be related to the MD driver.
- revise some messages.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.18 -r1.28.2.19 src/sys/dev/audio/audio.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/dev/audio

2021-02-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Feb 28 07:05:14 UTC 2021

Modified Files:
src/sys/dev/audio [netbsd-9]: audio.c

Log Message:
Pull up following revision(s) (requested by isaki in ticket #1217):

sys/dev/audio/audio.c: revision 1.46
sys/dev/audio/audio.c: revision 1.82
sys/dev/audio/audio.c: revision 1.85
sys/dev/audio/audio.c: revision 1.87
sys/dev/audio/audio.c: revision 1.88

Change two aprint_error_dev() to device_printf() (and improve messages).
This is also called from other than boot.

Add missing newline.

Revise comments.

Change (harmless) zero-length debug messages.
sys/modules is compiled with -Wzero-length-format and this
makes sys/modules compilable even if AUDIO_DEBUG is defined.

Improve error messages.
- prefix MD device name if it's considered to be related to the MD driver.
- revise some messages.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.18 -r1.28.2.19 src/sys/dev/audio/audio.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/dev/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.28.2.18 src/sys/dev/audio/audio.c:1.28.2.19
--- src/sys/dev/audio/audio.c:1.28.2.18	Sat Dec 19 13:54:56 2020
+++ src/sys/dev/audio/audio.c	Sun Feb 28 07:05:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.28.2.18 2020/12/19 13:54:56 martin Exp $	*/
+/*	$NetBSD: audio.c,v 1.28.2.19 2021/02/28 07:05:14 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -138,7 +138,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.28.2.18 2020/12/19 13:54:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.28.2.19 2021/02/28 07:05:14 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -518,6 +518,8 @@ static void audio_mixer_restore(struct a
 static void audio_softintr_rd(void *);
 static void audio_softintr_wr(void *);
 
+static void audio_printf(struct audio_softc *, const char *, ...)
+	__printflike(2, 3);
 static int audio_exlock_mutex_enter(struct audio_softc *);
 static void audio_exlock_mutex_exit(struct audio_softc *);
 static int audio_exlock_enter(struct audio_softc *);
@@ -965,19 +967,20 @@ audioattach(device_t parent, device_t se
 		perror = audio_hw_probe(sc, , AUMODE_PLAY);
 		rerror = audio_hw_probe(sc, , AUMODE_RECORD);
 		if (perror && rerror) {
-			aprint_error_dev(self, "audio_hw_probe failed, "
-			"perror = %d, rerror = %d\n", perror, rerror);
+			aprint_error_dev(self,
+			"audio_hw_probe failed: perror=%d, rerror=%d\n",
+			perror, rerror);
 			goto bad;
 		}
 		if (perror) {
 			mode &= ~AUMODE_PLAY;
-			aprint_error_dev(self, "audio_hw_probe failed with "
-			"%d, playback disabled\n", perror);
+			aprint_error_dev(self, "audio_hw_probe failed: "
+			"errno=%d, playback disabled\n", perror);
 		}
 		if (rerror) {
 			mode &= ~AUMODE_RECORD;
-			aprint_error_dev(self, "audio_hw_probe failed with "
-			"%d, capture disabled\n", rerror);
+			aprint_error_dev(self, "audio_hw_probe failed: "
+			"errno=%d, capture disabled\n", rerror);
 		}
 	} else {
 		/*
@@ -987,8 +990,8 @@ audioattach(device_t parent, device_t se
 		audio_format2_t *fmt = has_playback ?  : 
 		error = audio_hw_probe(sc, fmt, mode);
 		if (error) {
-			aprint_error_dev(self, "audio_hw_probe failed, "
-			"error = %d\n", error);
+			aprint_error_dev(self,
+			"audio_hw_probe failed: errno=%d\n", error);
 			goto bad;
 		}
 		if (has_playback && has_capture)
@@ -999,8 +1002,8 @@ audioattach(device_t parent, device_t se
 	/* hw_probe() also validates [pr]hwfmt.  */
 	error = audio_hw_set_format(sc, mode, , , , );
 	if (error) {
-		aprint_error_dev(self, "audio_hw_set_format failed, "
-		"error = %d\n", error);
+		aprint_error_dev(self,
+		"audio_hw_set_format failed: errno=%d\n", error);
 		goto bad;
 	}
 
@@ -1010,8 +1013,8 @@ audioattach(device_t parent, device_t se
 	 */
 	error = audio_mixers_init(sc, mode, , , , );
 	if (sc->sc_pmixer == NULL && sc->sc_rmixer == NULL) {
-		aprint_error_dev(self, "audio_mixers_init failed, "
-		"error = %d\n", error);
+		aprint_error_dev(self,
+		"audio_mixers_init failed: errno=%d\n", error);
 		goto bad;
 	}
 
@@ -1429,6 +1432,22 @@ audio_attach_mi(const struct audio_hw_if
 }
 
 /*
+ * audio_printf() outputs fmt... with the audio device name and MD device
+ * name prefixed.  If the message is considered to be related to the MD
+ * driver, use this one instead of device_printf().
+ */
+static void
+audio_printf(struct audio_softc *sc, const char *fmt, ...)
+{
+	va_list ap;
+
+	printf("%s(%s): ", device_xname(sc->sc_dev), device_xname(sc->hw_dev));
+	va_start(ap, fmt);
+	vprintf(fmt, ap);
+	va_end(ap);
+}
+
+/*
  * Enter critical section and also keep sc_lock.
  * If successful, returns 0 with sc_lock held.  Otherwise returns errno.
  * Must be called without sc_lock held.
@@ -1574,7 +1593,7 @@ 

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

2021-02-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Feb 28 07:01:01 UTC 2021

Modified Files:
src/sys/arch/hppa/gsc [netbsd-9]: harmony.c

Log Message:
Pull up following revision(s) (requested by isaki in ticket #1216):
sys/arch/hppa/gsc/harmony.c: revision 1.8
sys/arch/hppa/gsc/harmony.c: revision 1.9
sys/arch/hppa/gsc/harmony.c: revision 1.10

Fix locking against myself.
trigger_output will be called with sc_intr_lock held.

>From source code review, not tested.

Fix my mistakes in rev1.6.
- I had to merge the channel bit and the speed bits.
  Reported by macallan@.
- I also fix my indent, while I'm here.

Simplify harmony_speed_bits().
It no longer needs to write back the speed value.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.2.1 src/sys/arch/hppa/gsc/harmony.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/hppa/gsc/harmony.c
diff -u src/sys/arch/hppa/gsc/harmony.c:1.7 src/sys/arch/hppa/gsc/harmony.c:1.7.2.1
--- src/sys/arch/hppa/gsc/harmony.c:1.7	Sat Jun  8 08:02:37 2019
+++ src/sys/arch/hppa/gsc/harmony.c	Sun Feb 28 07:01:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: harmony.c,v 1.7 2019/06/08 08:02:37 isaki Exp $	*/
+/*	$NetBSD: harmony.c,v 1.7.2.1 2021/02/28 07:01:01 martin Exp $	*/
 
 /*	$OpenBSD: harmony.c,v 1.23 2004/02/13 21:28:19 mickey Exp $	*/
 
@@ -165,7 +165,7 @@ CFATTACH_DECL_NEW(harmony, sizeof(struct
 int harmony_intr(void *);
 void harmony_intr_enable(struct harmony_softc *);
 void harmony_intr_disable(struct harmony_softc *);
-uint32_t harmony_speed_bits(struct harmony_softc *, u_int *);
+uint32_t harmony_speed_bits(struct harmony_softc *, u_int);
 int harmony_set_gainctl(struct harmony_softc *);
 void harmony_reset_codec(struct harmony_softc *);
 void harmony_start_cp(struct harmony_softc *, int);
@@ -437,11 +437,10 @@ harmony_query_format(void *vsc, audio_fo
 int
 harmony_set_format(void *vsc, int setmode,
 const audio_params_t *play, const audio_params_t *rec,
-	audio_filter_reg_t *pfil, audio_filter_reg_t *rfil)
+audio_filter_reg_t *pfil, audio_filter_reg_t *rfil)
 {
 	struct harmony_softc *sc;
 	uint32_t bits;
-	int rate;
 
 	sc = vsc;
 
@@ -464,10 +463,8 @@ harmony_set_format(void *vsc, int setmod
 		bits |= CNTL_OLB;
 
 	bits |= CNTL_CHANS_STEREO;
-
-	/* XXX modify harmony_speed_bits() not to rewrite rate */
-	rate = play->sample_rate;
-	sc->sc_cntlbits |= harmony_speed_bits(sc, );
+	bits |= harmony_speed_bits(sc, play->sample_rate);
+	sc->sc_cntlbits = bits;
 	sc->sc_need_commit = 1;
 
 	return 0;
@@ -1004,8 +1001,6 @@ harmony_trigger_output(void *vsc, void *
 		return EINVAL;
 	}
 
-	mutex_spin_enter(>sc_intr_lock);
-
 	c->c_intr = intr;
 	c->c_intrarg = intrarg;
 	c->c_blksz = blksize;
@@ -1020,8 +1015,6 @@ harmony_trigger_output(void *vsc, void *
 	harmony_start_cp(sc, 0);
 	harmony_intr_enable(sc);
 
-	mutex_spin_exit(>sc_intr_lock);
-
 	return 0;
 }
 
@@ -1164,39 +1157,17 @@ static const struct speed_struct {
 };
 
 uint32_t
-harmony_speed_bits(struct harmony_softc *sc, u_int *speedp)
+harmony_speed_bits(struct harmony_softc *sc, u_int speed)
 {
-	int i, n, selected;
-
-	selected = -1;
-	n = sizeof(harmony_speeds) / sizeof(harmony_speeds[0]);
+	int i;
 
-	if ((*speedp) <= harmony_speeds[0].speed)
-		selected = 0;
-	else if ((*speedp) >= harmony_speeds[n - 1].speed)
-		selected = n - 1;
-	else {
-		for (i = 1; selected == -1 && i < n; i++) {
-			if ((*speedp) == harmony_speeds[i].speed)
-selected = i;
-			else if ((*speedp) < harmony_speeds[i].speed) {
-int diff1, diff2;
-
-diff1 = (*speedp) - harmony_speeds[i - 1].speed;
-diff2 = harmony_speeds[i].speed - (*speedp);
-if (diff1 < diff2)
-	selected = i - 1;
-else
-	selected = i;
-			}
+	for (i = 0; i < __arraycount(harmony_speeds); i++) {
+		if (speed == harmony_speeds[i].speed) {
+			return harmony_speeds[i].bits;
 		}
 	}
-
-	if (selected == -1)
-		selected = 2;
-
-	*speedp = harmony_speeds[selected].speed;
-	return harmony_speeds[selected].bits;
+	/* If this happens, harmony_formats[] is wrong */
+	panic("speed %u not supported", speed);
 }
 
 int



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

2021-02-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Feb 28 07:01:01 UTC 2021

Modified Files:
src/sys/arch/hppa/gsc [netbsd-9]: harmony.c

Log Message:
Pull up following revision(s) (requested by isaki in ticket #1216):
sys/arch/hppa/gsc/harmony.c: revision 1.8
sys/arch/hppa/gsc/harmony.c: revision 1.9
sys/arch/hppa/gsc/harmony.c: revision 1.10

Fix locking against myself.
trigger_output will be called with sc_intr_lock held.

>From source code review, not tested.

Fix my mistakes in rev1.6.
- I had to merge the channel bit and the speed bits.
  Reported by macallan@.
- I also fix my indent, while I'm here.

Simplify harmony_speed_bits().
It no longer needs to write back the speed value.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.2.1 src/sys/arch/hppa/gsc/harmony.c

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



CVS commit: src/libexec/httpd

2021-02-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 28 05:19:52 UTC 2021

Modified Files:
src/libexec/httpd: bozohttpd.8

Log Message:
update version, dates, add emily to list of contributors.  sort list.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/libexec/httpd/bozohttpd.8

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

Modified files:

Index: src/libexec/httpd/bozohttpd.8
diff -u src/libexec/httpd/bozohttpd.8:1.87 src/libexec/httpd/bozohttpd.8:1.88
--- src/libexec/httpd/bozohttpd.8:1.87	Thu Oct 15 09:54:22 2020
+++ src/libexec/httpd/bozohttpd.8	Sun Feb 28 05:19:52 2021
@@ -1,8 +1,8 @@
-.\"	$NetBSD: bozohttpd.8,v 1.87 2020/10/15 09:54:22 wiz Exp $
+.\"	$NetBSD: bozohttpd.8,v 1.88 2021/02/28 05:19:52 mrg Exp $
 .\"
 .\"	$eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $
 .\"
-.\" Copyright (c) 1997-2020 Matthew R. Green
+.\" Copyright (c) 1997-2021 Matthew R. Green
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd October 14, 2020
+.Dd February 27, 2021
 .Dt BOZOHTTPD 8
 .Os
 .Sh NAME
@@ -646,7 +646,7 @@ The focus has always been simplicity and
 and regular code audits.
 This manual documents
 .Nm
-version 20201014.
+version 20210227.
 .Sh AUTHORS
 .An -nosplit
 .Nm
@@ -699,6 +699,9 @@ added support for serving gzipped files 
 .Aq Mt p...@pdc.kth.se
 provided a fix for a minor (non-security) buffer overflow condition
 .It
+.Aq Mt emily@ingalls.rocks
+provided fixes for some bad request parsing
+.It
 .An Jun-ichiro itojun Hagino, KAME
 .Aq Mt ito...@iijlab.net
 provided initial IPv6 support
@@ -751,6 +754,10 @@ provided man page fixes
 .Aq Mt dena...@gmail.com
 provided a cgi-bin fix
 .It
+.An Jared McNeill
+.Aq Mt jmcne...@netbsd.org
+added support for readme in directory indexing
+.It
 .An Julio Merino
 .Aq Mt j...@netbsd.org
 Added the
@@ -789,6 +796,11 @@ provided the
 .Fl V
 option
 .It
+.An Jukka Ruohonen
+.Aq Mt jru...@netbsd.org
+provided support for
+.Xr blocklistd 8
+.It
 .An Thor Lancelot Simon
 .Aq Mt t...@netbsd.org
 enhanced cgi-bin support
@@ -807,15 +819,7 @@ provided http authorization fixes
 .It
 .Aq Mt x...@kittenz.org
 provided chroot and change-to-user support, and other various fixes
-.It
-.An Jukka Ruohonen
-.Aq Mt jru...@netbsd.org
-provided support for
-.Xr blocklistd 8
-.It
-.An Jared McNeill
-.Aq Mt jmcne...@netbsd.org
-added support for readme in directory indexing
+
 .It
 .An S.P.Zeidler
 .Aq Mt s...@netbsd.org



CVS commit: src/libexec/httpd

2021-02-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 28 05:19:52 UTC 2021

Modified Files:
src/libexec/httpd: bozohttpd.8

Log Message:
update version, dates, add emily to list of contributors.  sort list.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/libexec/httpd/bozohttpd.8

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



CVS commit: src/libexec/httpd

2021-02-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 28 04:18:46 UTC 2021

Modified Files:
src/libexec/httpd: Makefile

Log Message:
avoid warnings from the previous when using objdirs.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/libexec/httpd/Makefile

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

Modified files:

Index: src/libexec/httpd/Makefile
diff -u src/libexec/httpd/Makefile:1.30 src/libexec/httpd/Makefile:1.31
--- src/libexec/httpd/Makefile:1.30	Sun Feb 28 02:39:15 2021
+++ src/libexec/httpd/Makefile	Sun Feb 28 04:18:46 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.30 2021/02/28 02:39:15 mrg Exp $
+#	$NetBSD: Makefile,v 1.31 2021/02/28 04:18:46 mrg Exp $
 #
 #	$eterna: Makefile,v 1.30 2010/07/11 00:34:27 mrg Exp $
 #
@@ -84,7 +84,7 @@ check:
 .if empty(BOZOVER)
 BOZOVER!=	sed -n \
 		-e s/\"$$// -e \
-		's/\#define[ 	]*SERVER_SOFTWARE[ 	]*\"bozohttpd\///p'  bozohttpd.c
+		's/\#define[ 	]*SERVER_SOFTWARE[ 	]*\"bozohttpd\///p'  ${.PARSEDIR}/bozohttpd.c
 .endif
 
 # Create a distfile: uses /tmp



CVS commit: src/libexec/httpd

2021-02-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 28 04:18:46 UTC 2021

Modified Files:
src/libexec/httpd: Makefile

Log Message:
avoid warnings from the previous when using objdirs.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/libexec/httpd/Makefile

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



CVS commit: src

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 03:59:28 UTC 2021

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

Log Message:
lint: do not warn about constant expressions involving sizeof

These expressions are indeed constant for a specific platform, but on
another platform their value may change.  This makes them unsuspicious
and legitimate for portable code.

Seen in rump_syscalls.c, as 'sizeof(int) > sizeof(register_t)'.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_161.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_161.exp
cvs rdiff -u -r1.66 -r1.67 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.226 -r1.227 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-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 03:59:28 UTC 2021

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

Log Message:
lint: do not warn about constant expressions involving sizeof

These expressions are indeed constant for a specific platform, but on
another platform their value may change.  This makes them unsuspicious
and legitimate for portable code.

Seen in rump_syscalls.c, as 'sizeof(int) > sizeof(register_t)'.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_161.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_161.exp
cvs rdiff -u -r1.66 -r1.67 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.226 -r1.227 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_161.c
diff -u src/tests/usr.bin/xlint/lint1/msg_161.c:1.5 src/tests/usr.bin/xlint/lint1/msg_161.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_161.c:1.5	Sun Feb 28 03:29:12 2021
+++ src/tests/usr.bin/xlint/lint1/msg_161.c	Sun Feb 28 03:59:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_161.c,v 1.5 2021/02/28 03:29:12 rillig Exp $	*/
+/*	$NetBSD: msg_161.c,v 1.6 2021/02/28 03:59:28 rillig Exp $	*/
 # 3 "msg_161.c"
 
 // Test for message: constant in conditional context [161]
@@ -43,15 +43,15 @@ do_while_1(void)
 
 extern void println(const char *);
 
+/*
+ * Since 2021-02-28, lint no longer warns about constant controlling
+ * expressions involving sizeof since these are completely legitimate.
+ */
 void
 test_sizeof(void)
 {
-	/*
-	 * XXX: The following conditions should not need CONSTCOND as they
-	 * are perfectly legitimate.
-	 */
-	if (sizeof(int) > sizeof(char))		/* expect: 161 */
+	if (sizeof(int) > sizeof(char))
 		println("very probable");
-	if (sizeof(int) < sizeof(char))		/* expect: 161 */
+	if (sizeof(int) < sizeof(char))
 		println("impossible");
 }

Index: src/tests/usr.bin/xlint/lint1/msg_161.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_161.exp:1.4 src/tests/usr.bin/xlint/lint1/msg_161.exp:1.5
--- src/tests/usr.bin/xlint/lint1/msg_161.exp:1.4	Sun Feb 28 03:29:12 2021
+++ src/tests/usr.bin/xlint/lint1/msg_161.exp	Sun Feb 28 03:59:28 2021
@@ -1,5 +1,3 @@
 msg_161.c(11): warning: constant in conditional context [161]
 msg_161.c(18): warning: constant in conditional context [161]
 msg_161.c(41): warning: constant in conditional context [161]
-msg_161.c(53): warning: constant in conditional context [161]
-msg_161.c(55): warning: constant in conditional context [161]

Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.66 src/usr.bin/xlint/lint1/lint1.h:1.67
--- src/usr.bin/xlint/lint1/lint1.h:1.66	Mon Feb 22 15:09:50 2021
+++ src/usr.bin/xlint/lint1/lint1.h	Sun Feb 28 03:59:28 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.66 2021/02/22 15:09:50 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.67 2021/02/28 03:59:28 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -289,6 +289,7 @@ typedef	struct tnode {
 	bool	tn_cast : 1;	/* if tn_op == CVT, it's an explicit cast */
 	bool	tn_parenthesized : 1;
 	bool	tn_from_system_header : 1;
+	bool	tn_system_dependent : 1;
 	union {
 		struct {
 			struct	tnode *_tn_left;	/* (left) operand */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.226 src/usr.bin/xlint/lint1/tree.c:1.227
--- src/usr.bin/xlint/lint1/tree.c:1.226	Sun Feb 28 03:33:18 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Feb 28 03:59:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.226 2021/02/28 03:33:18 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.227 2021/02/28 03:59:28 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.226 2021/02/28 03:33:18 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.227 2021/02/28 03:59:28 rillig Exp $");
 #endif
 
 #include 
@@ -641,7 +641,8 @@ build(op_t op, tnode_t *ln, tnode_t *rn)
 	if (mp->m_left_test_context) {
 		if (ln->tn_op == CON ||
 		((mp->m_binary && op != QUEST) && rn->tn_op == CON)) {
-			if (hflag && !constcond_flag)
+			if (hflag && !constcond_flag &&
+			!ln->tn_system_dependent)
 /* constant in conditional context */
 warning(161);
 		}
@@ -3161,6 +3162,10 @@ fold(tnode_t *tn)
 	v->v_quad = xsign(q, t, -1);
 
 	cn = new_constant_node(tn->tn_type, v);
+	if (tn->tn_left->tn_system_dependent)
+		cn->tn_system_dependent = true;
+	if (modtab[tn->tn_op].m_binary && tn->tn_right->tn_system_dependent)
+		cn->tn_system_dependent = true;
 
 	return cn;
 }
@@ -3306,7 +3311,10 @@ fold_float(tnode_t *tn)
 tnode_t *
 build_sizeof(type_t *tp)
 {
-	return new_integer_constant_node(SIZEOF_TSPEC, tsize(tp) / CHAR_SIZE);
+	int64_t size_in_bytes = tsize(tp) / CHAR_SIZE;
+	tnode_t *tn = 

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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 03:33:18 UTC 2021

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

Log Message:
lint: rename parameter in function 'expr'

For symmetry with the function is_constcond_false.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 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/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.225 src/usr.bin/xlint/lint1/tree.c:1.226
--- src/usr.bin/xlint/lint1/tree.c:1.225	Sun Feb 28 02:00:05 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Feb 28 03:33:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.225 2021/02/28 02:00:05 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.226 2021/02/28 03:33:18 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.225 2021/02/28 02:00:05 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.226 2021/02/28 03:33:18 rillig Exp $");
 #endif
 
 #include 
@@ -3738,7 +3738,7 @@ is_constcond_false(const tnode_t *tn, ts
  * memory which is used for the expression.
  */
 void
-expr(tnode_t *tn, bool vctx, bool tctx, bool dofreeblk, bool constcond_zero_ok)
+expr(tnode_t *tn, bool vctx, bool tctx, bool dofreeblk, bool constcond_false_ok)
 {
 
 	lint_assert(tn != NULL || nerr != 0);
@@ -3759,7 +3759,7 @@ expr(tnode_t *tn, bool vctx, bool tctx, 
 			warning(159);
 	} else if (tn->tn_op == CON) {
 		if (hflag && tctx && !constcond_flag &&
-		!(constcond_zero_ok &&
+		!(constcond_false_ok &&
 		  is_constcond_false(tn, tn->tn_type->t_tspec)))
 			/* constant in conditional context */
 			warning(161);



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 03:33:18 UTC 2021

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

Log Message:
lint: rename parameter in function 'expr'

For symmetry with the function is_constcond_false.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 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/tests/usr.bin/xlint/lint1

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 03:29:12 UTC 2021

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

Log Message:
tests/lint: add test for constant expression involving sizeof


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_161.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_161.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-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 03:29:12 UTC 2021

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

Log Message:
tests/lint: add test for constant expression involving sizeof


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_161.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_161.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_161.c
diff -u src/tests/usr.bin/xlint/lint1/msg_161.c:1.4 src/tests/usr.bin/xlint/lint1/msg_161.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_161.c:1.4	Sun Jan 31 12:44:34 2021
+++ src/tests/usr.bin/xlint/lint1/msg_161.c	Sun Feb 28 03:29:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_161.c,v 1.4 2021/01/31 12:44:34 rillig Exp $	*/
+/*	$NetBSD: msg_161.c,v 1.5 2021/02/28 03:29:12 rillig Exp $	*/
 # 3 "msg_161.c"
 
 // Test for message: constant in conditional context [161]
@@ -40,3 +40,18 @@ do_while_1(void)
 
 	} while (1);		/* expect: 161 */
 }
+
+extern void println(const char *);
+
+void
+test_sizeof(void)
+{
+	/*
+	 * XXX: The following conditions should not need CONSTCOND as they
+	 * are perfectly legitimate.
+	 */
+	if (sizeof(int) > sizeof(char))		/* expect: 161 */
+		println("very probable");
+	if (sizeof(int) < sizeof(char))		/* expect: 161 */
+		println("impossible");
+}

Index: src/tests/usr.bin/xlint/lint1/msg_161.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_161.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_161.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_161.exp:1.3	Sun Jan 31 12:44:34 2021
+++ src/tests/usr.bin/xlint/lint1/msg_161.exp	Sun Feb 28 03:29:12 2021
@@ -1,3 +1,5 @@
 msg_161.c(11): warning: constant in conditional context [161]
 msg_161.c(18): warning: constant in conditional context [161]
 msg_161.c(41): warning: constant in conditional context [161]
+msg_161.c(53): warning: constant in conditional context [161]
+msg_161.c(55): warning: constant in conditional context [161]



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 03:14:44 UTC 2021

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

Log Message:
lint: document allowed types for bit-fields

No functional change.


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

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



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 03:14:44 UTC 2021

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

Log Message:
lint: document allowed types for bit-fields

No functional change.


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

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

Modified files:

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.141 src/usr.bin/xlint/lint1/decl.c:1.142
--- src/usr.bin/xlint/lint1/decl.c:1.141	Sun Feb 28 03:05:12 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Feb 28 03:14:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.141 2021/02/28 03:05:12 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.142 2021/02/28 03:14:44 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.141 2021/02/28 03:05:12 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.142 2021/02/28 03:14:44 rillig Exp $");
 #endif
 
 #include 
@@ -1071,16 +1071,23 @@ check_type(sym_t *sym)
 	}
 }
 
+/*
+ * In traditional C, the only portable type for bit-fields is unsigned int.
+ *
+ * In C90, the only allowed types for bit-fields are int, signed int and
+ * unsigned int (3.5.2.1).  There is no mention of implementation-defined
+ * types.
+ *
+ * In C99, the only portable types for bit-fields are _Bool, signed int and
+ * unsigned int (6.7.2.1p4).  In addition, C99 allows "or some other
+ * implementation-defined type".
+ */
 static void
-declare_bit_field(sym_t *const dsym, tspec_t *inout_t, type_t **const inout_tp)
+declare_bit_field(sym_t *dsym, tspec_t *inout_t, type_t **const inout_tp)
 {
 	tspec_t t = *inout_t;
 	type_t *tp = *inout_tp;
 
-	/*
-	 * only unsigned and signed int are portable bit-field types
-	 *(at least in ANSI C, in traditional C only unsigned int)
-	 */
 	if (t == CHAR || t == UCHAR || t == SCHAR ||
 	t == SHORT || t == USHORT || t == ENUM) {
 		if (!bitfieldtype_ok) {



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 03:05:12 UTC 2021

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

Log Message:
lint: extract declare_bit_field from declarator_1_struct_union

No functional change.


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

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

Modified files:

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.140 src/usr.bin/xlint/lint1/decl.c:1.141
--- src/usr.bin/xlint/lint1/decl.c:1.140	Sun Feb 28 02:45:37 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Feb 28 03:05:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.140 2021/02/28 02:45:37 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.141 2021/02/28 03:05:12 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.140 2021/02/28 02:45:37 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.141 2021/02/28 03:05:12 rillig Exp $");
 #endif
 
 #include 
@@ -1071,6 +1071,68 @@ check_type(sym_t *sym)
 	}
 }
 
+static void
+declare_bit_field(sym_t *const dsym, tspec_t *inout_t, type_t **const inout_tp)
+{
+	tspec_t t = *inout_t;
+	type_t *tp = *inout_tp;
+
+	/*
+	 * only unsigned and signed int are portable bit-field types
+	 *(at least in ANSI C, in traditional C only unsigned int)
+	 */
+	if (t == CHAR || t == UCHAR || t == SCHAR ||
+	t == SHORT || t == USHORT || t == ENUM) {
+		if (!bitfieldtype_ok) {
+			if (sflag) {
+/* bit-field type '%s' invalid in ANSI C */
+warning(273, type_name(tp));
+			} else if (pflag) {
+/* nonportable bit-field type */
+warning(34);
+			}
+		}
+	} else if (t == INT && dcs->d_smod == NOTSPEC) {
+		if (pflag && !bitfieldtype_ok) {
+			/* nonportable bit-field type */
+			warning(34);
+		}
+	} else if (t != INT && t != UINT && t != BOOL) {
+		/*
+		 * Non-integer types are always illegal for bitfields,
+		 * regardless of BITFIELDTYPE. Integer types not dealt with
+		 * above are okay only if BITFIELDTYPE is in effect.
+		 */
+		if (!bitfieldtype_ok || !is_integer(t)) {
+			/* illegal bit-field type '%s' */
+			warning(35, type_name(tp));
+			int sz = tp->t_flen;
+			dsym->s_type = tp = duptyp(gettyp(t = INT));
+			if ((tp->t_flen = sz) > size(t))
+tp->t_flen = size(t);
+		}
+	}
+
+	if (tp->t_flen < 0 || tp->t_flen > (ssize_t)size(t)) {
+		/* illegal bit-field size: %d */
+		error(36, tp->t_flen);
+		tp->t_flen = size(t);
+	} else if (tp->t_flen == 0 && dsym->s_name != unnamed) {
+		/* zero size bit-field */
+		error(37);
+		tp->t_flen = size(t);
+	}
+	if (dsym->s_scl == MOU) {
+		/* illegal use of bit-field */
+		error(41);
+		dsym->s_type->t_bitfield = false;
+		dsym->s_bitfield = false;
+	}
+
+	*inout_t = t;
+	*inout_tp = tp;
+}
+
 /*
  * Process the declarator of a struct/union element.
  */
@@ -1079,8 +1141,8 @@ declarator_1_struct_union(sym_t *dsym)
 {
 	type_t	*tp;
 	tspec_t	t;
-	int	sz, len;
-	int	o = 0;	/* Appease gcc */
+	int	sz;
+	int	o = 0;	/* Appease GCC */
 	scl_t	sc;
 
 	lint_assert((sc = dsym->s_scl) == MOS || sc == MOU);
@@ -1100,57 +1162,7 @@ declarator_1_struct_union(sym_t *dsym)
 	t = (tp = dsym->s_type)->t_tspec;
 
 	if (dsym->s_bitfield) {
-		/*
-		 * only unsigned and signed int are portable bit-field types
-		 *(at least in ANSI C, in traditional C only unsigned int)
-		 */
-		if (t == CHAR || t == UCHAR || t == SCHAR ||
-		t == SHORT || t == USHORT || t == ENUM) {
-			if (!bitfieldtype_ok) {
-if (sflag) {
-	/* bit-field type '%s' invalid ... */
-	warning(273, type_name(tp));
-} else if (pflag) {
-	/* nonportable bit-field type */
-	warning(34);
-}
-			}
-		} else if (t == INT && dcs->d_smod == NOTSPEC) {
-			if (pflag && !bitfieldtype_ok) {
-/* nonportable bit-field type */
-warning(34);
-			}
-		} else if (t != INT && t != UINT && t != BOOL) {
-			/*
-			 * Non-integer types are always illegal for
-			 * bitfields, regardless of BITFIELDTYPE.
-			 * Integer types not dealt with above are
-			 * okay only if BITFIELDTYPE is in effect.
-			 */
-			if (!bitfieldtype_ok || !is_integer(t)) {
-/* illegal bit-field type '%s' */
-warning(35, type_name(tp));
-sz = tp->t_flen;
-dsym->s_type = tp = duptyp(gettyp(t = INT));
-if ((tp->t_flen = sz) > size(t))
-	tp->t_flen = size(t);
-			}
-		}
-		if ((len = tp->t_flen) < 0 || len > (ssize_t)size(t)) {
-			/* illegal bit-field size: %d */
-			error(36, len);
-			tp->t_flen = size(t);
-		} else if (len == 0 && dsym->s_name != unnamed) {
-			/* zero size bit-field */
-			error(37);
-			tp->t_flen = size(t);
-		}
-		if (dsym->s_scl == MOU) {
-			/* illegal use of bit-field */
-			error(41);
-			dsym->s_type->t_bitfield = false;
-			dsym->s_bitfield = false;
-		}
+		declare_bit_field(dsym, , );
 	} else if (t == FUNC) {
 		/* function 

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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 03:05:12 UTC 2021

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

Log Message:
lint: extract declare_bit_field from declarator_1_struct_union

No functional change.


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

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



CVS commit: src

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 02:45:37 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_035.c msg_035.exp
src/usr.bin/xlint/lint1: decl.c err.c

Log Message:
lint: add type information to 'illegal bit-field type'


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_035.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_035.exp
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/xlint/lint1/err.c

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



CVS commit: src

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 02:45:37 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_035.c msg_035.exp
src/usr.bin/xlint/lint1: decl.c err.c

Log Message:
lint: add type information to 'illegal bit-field type'


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_035.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_035.exp
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/xlint/lint1/err.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_035.c
diff -u src/tests/usr.bin/xlint/lint1/msg_035.c:1.6 src/tests/usr.bin/xlint/lint1/msg_035.c:1.7
--- src/tests/usr.bin/xlint/lint1/msg_035.c:1.6	Sun Jan 31 11:12:07 2021
+++ src/tests/usr.bin/xlint/lint1/msg_035.c	Sun Feb 28 02:45:37 2021
@@ -1,7 +1,7 @@
-/*	$NetBSD: msg_035.c,v 1.6 2021/01/31 11:12:07 rillig Exp $	*/
+/*	$NetBSD: msg_035.c,v 1.7 2021/02/28 02:45:37 rillig Exp $	*/
 # 3 "msg_035.c"
 
-// Test for message: illegal bit-field type [35]
+// Test for message: illegal bit-field type '%s' [35]
 
 /*
  * In traditional C, only unsigned int is a portable bit-field type.

Index: src/tests/usr.bin/xlint/lint1/msg_035.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_035.exp:1.7 src/tests/usr.bin/xlint/lint1/msg_035.exp:1.8
--- src/tests/usr.bin/xlint/lint1/msg_035.exp:1.7	Sun Jan 31 11:23:01 2021
+++ src/tests/usr.bin/xlint/lint1/msg_035.exp	Sun Feb 28 02:45:37 2021
@@ -1,19 +1,19 @@
-msg_035.c(41): warning: illegal bit-field type [35]
-msg_035.c(42): warning: illegal bit-field type [35]
-msg_035.c(43): warning: illegal bit-field type [35]
-msg_035.c(44): warning: illegal bit-field type [35]
-msg_035.c(47): warning: illegal bit-field type [35]
-msg_035.c(48): warning: illegal bit-field type [35]
-msg_035.c(49): warning: illegal bit-field type [35]
+msg_035.c(41): warning: illegal bit-field type 'long' [35]
+msg_035.c(42): warning: illegal bit-field type 'unsigned long' [35]
+msg_035.c(43): warning: illegal bit-field type 'long long' [35]
+msg_035.c(44): warning: illegal bit-field type 'unsigned long long' [35]
+msg_035.c(47): warning: illegal bit-field type 'float' [35]
+msg_035.c(48): warning: illegal bit-field type 'double' [35]
+msg_035.c(49): warning: illegal bit-field type 'long double' [35]
 msg_035.c(50): void type for 'void_flag' [19]
 msg_035.c(50): zero size bit-field [37]
-msg_035.c(51): warning: illegal bit-field type [35]
-msg_035.c(52): warning: illegal bit-field type [35]
-msg_035.c(54): warning: illegal bit-field type [35]
-msg_035.c(55): warning: illegal bit-field type [35]
-msg_035.c(56): warning: illegal bit-field type [35]
+msg_035.c(51): warning: illegal bit-field type 'struct typedef example_struct' [35]
+msg_035.c(52): warning: illegal bit-field type 'union typedef example_union' [35]
+msg_035.c(54): warning: illegal bit-field type 'pointer to void' [35]
+msg_035.c(55): warning: illegal bit-field type 'array of unsigned int[4]' [35]
+msg_035.c(56): warning: illegal bit-field type 'function(int, pointer to const char) returning void' [35]
 msg_035.c(57): invalid type for _Complex [308]
-msg_035.c(57): warning: illegal bit-field type [35]
-msg_035.c(58): warning: illegal bit-field type [35]
-msg_035.c(59): warning: illegal bit-field type [35]
-msg_035.c(60): warning: illegal bit-field type [35]
+msg_035.c(57): warning: illegal bit-field type 'double _Complex' [35]
+msg_035.c(58): warning: illegal bit-field type 'float _Complex' [35]
+msg_035.c(59): warning: illegal bit-field type 'double _Complex' [35]
+msg_035.c(60): warning: illegal bit-field type 'long double _Complex' [35]

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.139 src/usr.bin/xlint/lint1/decl.c:1.140
--- src/usr.bin/xlint/lint1/decl.c:1.139	Sun Feb 28 00:23:55 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Feb 28 02:45:37 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.139 2021/02/28 00:23:55 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.140 2021/02/28 02:45:37 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.139 2021/02/28 00:23:55 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.140 2021/02/28 02:45:37 rillig Exp $");
 #endif
 
 #include 
@@ -1128,8 +1128,8 @@ declarator_1_struct_union(sym_t *dsym)
 			 * okay only if BITFIELDTYPE is in effect.
 			 */
 			if (!bitfieldtype_ok || !is_integer(t)) {
-/* illegal bit-field type */
-warning(35);
+/* illegal bit-field type '%s' */
+warning(35, type_name(tp));
 sz = tp->t_flen;
 dsym->s_type = tp = duptyp(gettyp(t = INT));
 if ((tp->t_flen = sz) > size(t))

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.85 

CVS commit: src/libexec/httpd

2021-02-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 28 02:39:15 UTC 2021

Modified Files:
src/libexec/httpd: Makefile

Log Message:
give BOZOVER a default so exporting a distfile is easy.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/libexec/httpd/Makefile

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

Modified files:

Index: src/libexec/httpd/Makefile
diff -u src/libexec/httpd/Makefile:1.29 src/libexec/httpd/Makefile:1.30
--- src/libexec/httpd/Makefile:1.29	Sat Jul 11 08:10:52 2020
+++ src/libexec/httpd/Makefile	Sun Feb 28 02:39:15 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.29 2020/07/11 08:10:52 jruoho Exp $
+#	$NetBSD: Makefile,v 1.30 2021/02/28 02:39:15 mrg Exp $
 #
 #	$eterna: Makefile,v 1.30 2010/07/11 00:34:27 mrg Exp $
 #
@@ -81,6 +81,12 @@ CLEANFILES+=	bozohttpd.8.html bozohttpd.
 check:
 	cd ${.CURDIR}/testsuite && ${MAKE} check
 
+.if empty(BOZOVER)
+BOZOVER!=	sed -n \
+		-e s/\"$$// -e \
+		's/\#define[ 	]*SERVER_SOFTWARE[ 	]*\"bozohttpd\///p'  bozohttpd.c
+.endif
+
 # Create a distfile: uses /tmp
 BASE=bozohttpd-${BOZOVER}
 TAR=${BASE}.tar



CVS commit: src/libexec/httpd

2021-02-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 28 02:39:15 UTC 2021

Modified Files:
src/libexec/httpd: Makefile

Log Message:
give BOZOVER a default so exporting a distfile is easy.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/libexec/httpd/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/common

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 02:37:04 UTC 2021

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

Log Message:
lint: extract type_name_of_array from type_name

No functional change.


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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 02:37:04 UTC 2021

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

Log Message:
lint: extract type_name_of_array from type_name

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/xlint/common/tyname.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.32 src/usr.bin/xlint/common/tyname.c:1.33
--- src/usr.bin/xlint/common/tyname.c:1.32	Sun Feb 28 02:29:28 2021
+++ src/usr.bin/xlint/common/tyname.c	Sun Feb 28 02:37:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.32 2021/02/28 02:29:28 rillig Exp $	*/
+/*	$NetBSD: tyname.c,v 1.33 2021/02/28 02:37:04 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.32 2021/02/28 02:29:28 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.33 2021/02/28 02:37:04 rillig Exp $");
 #endif
 
 #include 
@@ -314,6 +314,23 @@ type_name_of_enum(buffer *buf, const typ
 #endif
 }
 
+static void
+type_name_of_array(buffer *buf, const type_t *tp)
+{
+	buf_add(buf, " of ");
+	buf_add(buf, type_name(tp->t_subt));
+	buf_add(buf, "[");
+#ifdef t_str /* lint1 */
+	if (tp->t_incomplete_array)
+		buf_add(buf, "unknown_size");
+	else
+		buf_add_int(buf, tp->t_dim);
+#else
+	buf_add_int(buf, tp->t_dim);
+#endif
+	buf_add(buf, "]");
+}
+
 const char *
 type_name(const type_t *tp)
 {
@@ -379,23 +396,11 @@ type_name(const type_t *tp)
 		type_name_of_struct_or_union(, tp);
 		break;
 	case ARRAY:
-		buf_add(, " of ");
-		buf_add(, type_name(tp->t_subt));
-		buf_add(, "[");
-#ifdef t_str /* lint1 */
-		if (tp->t_incomplete_array)
-			buf_add(, "unknown_size");
-		else
-			buf_add_int(, tp->t_dim);
-#else
-		buf_add_int(, tp->t_dim);
-#endif
-		buf_add(, "]");
+		type_name_of_array(, tp);
 		break;
 	case FUNC:
 		type_name_of_function(, tp);
 		break;
-
 	default:
 		LERROR("type_name(%d)", t);
 	}



CVS commit: src

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 02:29:29 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_210.exp msg_245.exp
src/usr.bin/xlint/common: tyname.c

Log Message:
lint: output precise type information for struct/union/enum

Previously, 'typedef enum { E } name' was output as 'name', which
omitted the information that this was an enum type.  Now it is output as
'enum typedef name'.

Previously, 'typedef struct { int member; } name' was output as 'struct
', which omitted the typedef name.  Now it is output as 'struct
typedef name'.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_210.exp
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_245.exp
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/xlint/common/tyname.c

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



CVS commit: src

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 02:29:29 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_210.exp msg_245.exp
src/usr.bin/xlint/common: tyname.c

Log Message:
lint: output precise type information for struct/union/enum

Previously, 'typedef enum { E } name' was output as 'name', which
omitted the information that this was an enum type.  Now it is output as
'enum typedef name'.

Previously, 'typedef struct { int member; } name' was output as 'struct
', which omitted the typedef name.  Now it is output as 'struct
typedef name'.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_210.exp
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_245.exp
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/xlint/common/tyname.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_210.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_210.exp:1.4 src/tests/usr.bin/xlint/lint1/msg_210.exp:1.5
--- src/tests/usr.bin/xlint/lint1/msg_210.exp:1.4	Mon Feb 22 15:09:50 2021
+++ src/tests/usr.bin/xlint/lint1/msg_210.exp	Sun Feb 28 02:29:28 2021
@@ -1,2 +1,2 @@
 msg_210.c(23): warning: enum type mismatch between 'enum A' and 'enum B' in initialization [210]
-msg_210.c(25): warning: enum type mismatch between 'C' and 'D' in initialization [210]
+msg_210.c(25): warning: enum type mismatch between 'enum typedef C' and 'enum typedef D' in initialization [210]

Index: src/tests/usr.bin/xlint/lint1/msg_245.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_245.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_245.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_245.exp:1.3	Sun Feb 28 02:00:06 2021
+++ src/tests/usr.bin/xlint/lint1/msg_245.exp	Sun Feb 28 02:29:28 2021
@@ -1,3 +1,3 @@
 msg_245.c(29): warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct only_tag' [245]
-msg_245.c(30): warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct ' [245]
+msg_245.c(30): warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct typedef only_typedef' [245]
 msg_245.c(31): warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct ' [245]

Index: src/usr.bin/xlint/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.31 src/usr.bin/xlint/common/tyname.c:1.32
--- src/usr.bin/xlint/common/tyname.c:1.31	Sun Feb 21 14:19:27 2021
+++ src/usr.bin/xlint/common/tyname.c	Sun Feb 28 02:29:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.31 2021/02/21 14:19:27 rillig Exp $	*/
+/*	$NetBSD: tyname.c,v 1.32 2021/02/28 02:29:28 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.31 2021/02/21 14:19:27 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.32 2021/02/28 02:29:28 rillig Exp $");
 #endif
 
 #include 
@@ -280,6 +280,40 @@ type_name_of_function(buffer *buf, const
 	buf_add(buf, type_name(tp->t_subt));
 }
 
+static void
+type_name_of_struct_or_union(buffer *buf, const type_t *tp)
+{
+	buf_add(buf, " ");
+#ifdef t_str
+	if (tp->t_str->sou_tag->s_name == unnamed &&
+	tp->t_str->sou_first_typedef != NULL) {
+		buf_add(buf, "typedef ");
+		buf_add(buf, tp->t_str->sou_first_typedef->s_name);
+	} else {
+		buf_add(buf, tp->t_str->sou_tag->s_name);
+	}
+#else
+	buf_add(buf, tp->t_isuniqpos ? "*anonymous*" : tp->t_tag->h_name);
+#endif
+}
+
+static void
+type_name_of_enum(buffer *buf, const type_t *tp)
+{
+	buf_add(buf, " ");
+#ifdef t_enum
+	if (tp->t_enum->en_tag->s_name == unnamed &&
+	tp->t_enum->en_first_typedef != NULL) {
+		buf_add(buf, "typedef ");
+		buf_add(buf, tp->t_enum->en_first_typedef->s_name);
+	} else {
+		buf_add(buf, tp->t_enum->en_tag->s_name);
+	}
+#else
+	buf_add(buf, tp->t_isuniqpos ? "*anonymous*" : tp->t_tag->h_name);
+#endif
+}
+
 const char *
 type_name(const type_t *tp)
 {
@@ -302,6 +336,7 @@ type_name(const type_t *tp)
 		buf_add(, "const ");
 	if (tp->t_volatile)
 		buf_add(, "volatile ");
+
 	buf_add(, tspec_name(t));
 
 	switch (t) {
@@ -337,30 +372,11 @@ type_name(const type_t *tp)
 		buf_add(, type_name(tp->t_subt));
 		break;
 	case ENUM:
-#ifdef t_enum
-		if (tp->t_enum->en_tag->s_name == unnamed &&
-		tp->t_enum->en_first_typedef != NULL) {
-			buf.len -= strlen(tspec_name(t));
-			buf_add(, tp->t_enum->en_first_typedef->s_name);
-		} else {
-			buf_add(, " ");
-			buf_add(, tp->t_enum->en_tag->s_name);
-		}
-#else
-		buf_add(, " ");
-		buf_add(,
-		tp->t_isuniqpos ? "*anonymous*" : tp->t_tag->h_name);
-#endif
+		type_name_of_enum(, tp);
 		break;
 	case STRUCT:
 	case UNION:
-		buf_add(, " ");
-#ifdef t_str
-		buf_add(, tp->t_str->sou_tag->s_name);
-#else
-		buf_add(,
-		tp->t_isuniqpos 

CVS commit: src

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 02:00:06 UTC 2021

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

Log Message:
lint: add type information for 'incompatible struct pointers'


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_245.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_245.exp
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.224 -r1.225 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_245.c
diff -u src/tests/usr.bin/xlint/lint1/msg_245.c:1.3 src/tests/usr.bin/xlint/lint1/msg_245.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_245.c:1.3	Sun Feb 28 01:53:49 2021
+++ src/tests/usr.bin/xlint/lint1/msg_245.c	Sun Feb 28 02:00:06 2021
@@ -1,7 +1,7 @@
-/*	$NetBSD: msg_245.c,v 1.3 2021/02/28 01:53:49 rillig Exp $	*/
+/*	$NetBSD: msg_245.c,v 1.4 2021/02/28 02:00:06 rillig Exp $	*/
 # 3 "msg_245.c"
 
-// Test for message: illegal structure pointer combination, op %s [245]
+// Test for message: incompatible structure pointers: '%s' '%s' '%s' [245]
 
 typedef struct tag_and_typedef_tag {
 	int member;

Index: src/tests/usr.bin/xlint/lint1/msg_245.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_245.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_245.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_245.exp:1.2	Sun Feb 28 01:53:49 2021
+++ src/tests/usr.bin/xlint/lint1/msg_245.exp	Sun Feb 28 02:00:06 2021
@@ -1,3 +1,3 @@
-msg_245.c(29): warning: illegal structure pointer combination, op == [245]
-msg_245.c(30): warning: illegal structure pointer combination, op == [245]
-msg_245.c(31): warning: illegal structure pointer combination, op == [245]
+msg_245.c(29): warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct only_tag' [245]
+msg_245.c(30): warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct ' [245]
+msg_245.c(31): warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct ' [245]

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.84 src/usr.bin/xlint/lint1/err.c:1.85
--- src/usr.bin/xlint/lint1/err.c:1.84	Sun Feb 28 01:30:22 2021
+++ src/usr.bin/xlint/lint1/err.c	Sun Feb 28 02:00:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.84 2021/02/28 01:30:22 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.85 2021/02/28 02:00: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.84 2021/02/28 01:30:22 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.85 2021/02/28 02:00:05 rillig Exp $");
 #endif
 
 #include 
@@ -304,7 +304,7 @@ const	char *msgs[] = {
 	"combination of '%s' and '%s', op %s",			  /* 242 */
 	"dubious comparison of enums, op %s",			  /* 243 */
 	"illegal structure pointer combination",		  /* 244 */
-	"illegal structure pointer combination, op %s",		  /* 245 */
+	"incompatible structure pointers: '%s' '%s' '%s'",	  /* 245 */
 	"dubious conversion of enum to '%s'",			  /* 246 */
 	"pointer cast from '%s' to '%s' may be troublesome",	  /* 247 */
 	"floating-point constant out of range",			  /* 248 */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.224 src/usr.bin/xlint/lint1/tree.c:1.225
--- src/usr.bin/xlint/lint1/tree.c:1.224	Sun Feb 28 01:30:22 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Feb 28 02:00:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.224 2021/02/28 01:30:22 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.225 2021/02/28 02:00:05 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.224 2021/02/28 01:30:22 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.225 2021/02/28 02:00:05 rillig Exp $");
 #endif
 
 #include 
@@ -2567,8 +2567,8 @@ warn_incompatible_pointers(const mod_t *
 			/* illegal structure pointer combination */
 			warning(244);
 		} else {
-			/* illegal structure pointer combination, op %s */
-			warning(245, mp->m_name);
+			/* incompatible structure pointers: '%s' '%s' '%s' */
+			warning(245, type_name(ltp), mp->m_name, type_name(rtp));
 		}
 	} else {
 		if (mp == NULL) {



CVS commit: src

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 02:00:06 UTC 2021

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

Log Message:
lint: add type information for 'incompatible struct pointers'


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_245.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_245.exp
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.224 -r1.225 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/tests/usr.bin/xlint/lint1

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 01:53:50 UTC 2021

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

Log Message:
tests/lint: add test for 'illegal structure pointer combination'


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_245.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_245.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_245.c
diff -u src/tests/usr.bin/xlint/lint1/msg_245.c:1.2 src/tests/usr.bin/xlint/lint1/msg_245.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_245.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_245.c	Sun Feb 28 01:53:49 2021
@@ -1,7 +1,32 @@
-/*	$NetBSD: msg_245.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_245.c,v 1.3 2021/02/28 01:53:49 rillig Exp $	*/
 # 3 "msg_245.c"
 
 // Test for message: illegal structure pointer combination, op %s [245]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+typedef struct tag_and_typedef_tag {
+	int member;
+} tag_and_typedef_typedef;
+
+struct only_tag {
+	int member;
+};
+
+typedef struct {
+	int member;
+} only_typedef;
+
+struct {
+	int member;
+} unnamed;
+
+void sink_bool(_Bool);
+
+void
+example(tag_and_typedef_typedef both,
+	only_typedef only_typedef,
+	struct only_tag only_tag)
+{
+	sink_bool( == _tag);		/* expect: 245 */
+	sink_bool( == _typedef);	/* expect: 245 */
+	sink_bool( == );		/* expect: 245 */
+}

Index: src/tests/usr.bin/xlint/lint1/msg_245.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_245.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_245.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_245.exp:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_245.exp	Sun Feb 28 01:53:49 2021
@@ -1 +1,3 @@
-msg_245.c(6): syntax error ':' [249]
+msg_245.c(29): warning: illegal structure pointer combination, op == [245]
+msg_245.c(30): warning: illegal structure pointer combination, op == [245]
+msg_245.c(31): warning: illegal structure pointer combination, op == [245]



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 01:53:50 UTC 2021

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

Log Message:
tests/lint: add test for 'illegal structure pointer combination'


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_245.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_245.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-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 01:36:46 UTC 2021

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

Log Message:
tests/lint: add test for unconst pointer cast


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_275.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_275.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_275.c
diff -u src/tests/usr.bin/xlint/lint1/msg_275.c:1.2 src/tests/usr.bin/xlint/lint1/msg_275.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_275.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_275.c	Sun Feb 28 01:36:46 2021
@@ -1,7 +1,18 @@
-/*	$NetBSD: msg_275.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_275.c,v 1.3 2021/02/28 01:36:46 rillig Exp $	*/
 # 3 "msg_275.c"
 
 // Test for message: cast discards 'const' from pointer target type [275]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+/* lint1-extra-flags: -h */
+
+char *
+unconst_string(const char *s)
+{
+	return (char *)s;	/* expect: 275 */
+}
+
+const char *
+const_string(char *s)
+{
+	return (const char *)s;
+}

Index: src/tests/usr.bin/xlint/lint1/msg_275.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_275.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_275.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_275.exp:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_275.exp	Sun Feb 28 01:36:46 2021
@@ -1 +1 @@
-msg_275.c(6): syntax error ':' [249]
+msg_275.c(11): warning: cast discards 'const' from type 'pointer to const char' [275]



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 01:36:46 UTC 2021

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

Log Message:
tests/lint: add test for unconst pointer cast


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

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



CVS commit: src

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 01:30:22 UTC 2021

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

Log Message:
lint: add type information to enum type mismatch


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_130.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_130.exp
cvs rdiff -u -r1.83 -r1.84 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.223 -r1.224 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_130.c
diff -u src/tests/usr.bin/xlint/lint1/msg_130.c:1.4 src/tests/usr.bin/xlint/lint1/msg_130.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_130.c:1.4	Sat Feb 27 13:43:36 2021
+++ src/tests/usr.bin/xlint/lint1/msg_130.c	Sun Feb 28 01:30:22 2021
@@ -1,7 +1,7 @@
-/*	$NetBSD: msg_130.c,v 1.4 2021/02/27 13:43:36 rillig Exp $	*/
+/*	$NetBSD: msg_130.c,v 1.5 2021/02/28 01:30:22 rillig Exp $	*/
 # 3 "msg_130.c"
 
-// Test for message: enum type mismatch, op %s [130]
+// Test for message: enum type mismatch: '%s' '%s' '%s' [130]
 
 enum color {
 	RED	= 1 << 0,

Index: src/tests/usr.bin/xlint/lint1/msg_130.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_130.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_130.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_130.exp:1.3	Sat Feb 27 13:43:36 2021
+++ src/tests/usr.bin/xlint/lint1/msg_130.exp	Sun Feb 28 01:30:22 2021
@@ -1,3 +1,3 @@
-msg_130.c(27): warning: enum type mismatch, op : [130]
-msg_130.c(29): warning: enum type mismatch, op != [130]
-msg_130.c(30): warning: enum type mismatch, op == [130]
+msg_130.c(27): warning: enum type mismatch: 'enum color' ':' 'enum daytime' [130]
+msg_130.c(29): warning: enum type mismatch: 'enum color' '!=' 'enum size' [130]
+msg_130.c(30): warning: enum type mismatch: 'enum color' '==' 'enum size' [130]

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.83 src/usr.bin/xlint/lint1/err.c:1.84
--- src/usr.bin/xlint/lint1/err.c:1.83	Sun Feb 28 01:06:57 2021
+++ src/usr.bin/xlint/lint1/err.c	Sun Feb 28 01:30:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.83 2021/02/28 01:06:57 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.84 2021/02/28 01:30:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.83 2021/02/28 01:06:57 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.84 2021/02/28 01:30:22 rillig Exp $");
 #endif
 
 #include 
@@ -189,7 +189,7 @@ const	char *msgs[] = {
 	"'&' before array or function: ignored",		  /* 127 */
 	"operands have incompatible pointer types, op %s (%s != %s)", /* 128 */
 	"expression has null effect",  /* 129 */
-	"enum type mismatch, op %s",  /* 130 */
+	"enum type mismatch: '%s' '%s' '%s'",			  /* 130 */
 	"conversion to '%s' may sign-extend incorrectly",	  /* 131 */
 	"conversion from '%s' to '%s' may lose accuracy",	  /* 132 */
 	"conversion of pointer to '%s' loses bits",		  /* 133 */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.223 src/usr.bin/xlint/lint1/tree.c:1.224
--- src/usr.bin/xlint/lint1/tree.c:1.223	Sun Feb 28 01:06:57 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Feb 28 01:30:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.223 2021/02/28 01:06:57 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.224 2021/02/28 01:30:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.223 2021/02/28 01:06:57 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.224 2021/02/28 01:30:22 rillig Exp $");
 #endif
 
 #include 
@@ -1732,8 +1732,9 @@ check_enum_type_mismatch(op_t op, int ar
 			type_name(ln->tn_type), type_name(rn->tn_type));
 			break;
 		default:
-			/* enum type mismatch, op %s */
-			warning(130, mp->m_name);
+			/* enum type mismatch: '%s' '%s' '%s' */
+			warning(130, type_name(ln->tn_type), mp->m_name,
+			type_name(rn->tn_type));
 			break;
 		}
 	} else if (Pflag && mp->m_comparison && op != EQ && op != NE) {



CVS commit: src

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 01:30:22 UTC 2021

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

Log Message:
lint: add type information to enum type mismatch


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_130.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_130.exp
cvs rdiff -u -r1.83 -r1.84 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.223 -r1.224 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/tests/usr.bin/xlint/lint1

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 01:22:02 UTC 2021

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

Log Message:
tests/lint: add test for '<<' in traditional C


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_118.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_118.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-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 01:22:02 UTC 2021

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

Log Message:
tests/lint: add test for '<<' in traditional C


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_118.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_118.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_118.c
diff -u src/tests/usr.bin/xlint/lint1/msg_118.c:1.2 src/tests/usr.bin/xlint/lint1/msg_118.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_118.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_118.c	Sun Feb 28 01:22:02 2021
@@ -1,7 +1,18 @@
-/*	$NetBSD: msg_118.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_118.c,v 1.3 2021/02/28 01:22:02 rillig Exp $	*/
 # 3 "msg_118.c"
 
 // Test for message: semantics of '%s' change in ANSI C; use explicit cast [118]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+/* lint1-extra-flags: -h */
+
+int
+int_shl_uint(int i, unsigned int u)
+{
+	return i << u;
+}
+
+unsigned
+uint_shl_ulong(unsigned a, unsigned long ul)
+{
+	return a << ul;		/* expect: 118 */
+}

Index: src/tests/usr.bin/xlint/lint1/msg_118.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_118.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_118.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_118.exp:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_118.exp	Sun Feb 28 01:22:02 2021
@@ -1 +1 @@
-msg_118.c(6): syntax error ':' [249]
+msg_118.c(17): warning: semantics of '<<' change in ANSI C; use explicit cast [118]



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 01:20:54 UTC 2021

Modified Files:
src/tests/usr.bin/xlint: check-expect.lua
src/tests/usr.bin/xlint/lint1: msg_135.c msg_153.c msg_229.c

Log Message:
tests/lint: force 'expect' annotations


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/check-expect.lua
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_135.c \
src/tests/usr.bin/xlint/lint1/msg_153.c \
src/tests/usr.bin/xlint/lint1/msg_229.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/check-expect.lua
diff -u src/tests/usr.bin/xlint/check-expect.lua:1.5 src/tests/usr.bin/xlint/check-expect.lua:1.6
--- src/tests/usr.bin/xlint/check-expect.lua:1.5	Sat Feb 27 17:16:48 2021
+++ src/tests/usr.bin/xlint/check-expect.lua	Sun Feb 28 01:20:54 2021
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.5 2021/02/27 17:16:48 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.6 2021/02/28 01:20:54 rillig Exp $
 
 --[[
 
@@ -90,9 +90,11 @@ end
 
 local function check_test(c_fname, errors)
   local exp_fname = c_fname:gsub("%.c$", ".exp")
+
   local comment_linenos, comments_by_lineno =
 load_expect_comments_from_c(c_fname, errors)
-  if comment_linenos == nil or #comment_linenos == 0 then return end
+  if comment_linenos == nil then return end
+
   local messages = load_actual_messages_from_exp(exp_fname)
   if messages == nil then return end
 

Index: src/tests/usr.bin/xlint/lint1/msg_135.c
diff -u src/tests/usr.bin/xlint/lint1/msg_135.c:1.4 src/tests/usr.bin/xlint/lint1/msg_135.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_135.c:1.4	Sun Feb 28 00:40:22 2021
+++ src/tests/usr.bin/xlint/lint1/msg_135.c	Sun Feb 28 01:20:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_135.c,v 1.4 2021/02/28 00:40:22 rillig Exp $	*/
+/*	$NetBSD: msg_135.c,v 1.5 2021/02/28 01:20:54 rillig Exp $	*/
 # 3 "msg_135.c"
 
 // Test for message: converting '%s' to '%s' may cause alignment problem [135]
@@ -10,7 +10,7 @@ read_uint(const unsigned char **pp)
 {
 	unsigned val;
 
-	val = *(const unsigned *)(*pp);
+	val = *(const unsigned *)(*pp);	/* expect: 135 */
 	pp += sizeof(unsigned);
 	return val;
 }
Index: src/tests/usr.bin/xlint/lint1/msg_153.c
diff -u src/tests/usr.bin/xlint/lint1/msg_153.c:1.4 src/tests/usr.bin/xlint/lint1/msg_153.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_153.c:1.4	Sun Feb 28 01:06:57 2021
+++ src/tests/usr.bin/xlint/lint1/msg_153.c	Sun Feb 28 01:20:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_153.c,v 1.4 2021/02/28 01:06:57 rillig Exp $	*/
+/*	$NetBSD: msg_153.c,v 1.5 2021/02/28 01:20:54 rillig Exp $	*/
 # 3 "msg_153.c"
 
 // Test for message: converting '%s' to incompatible '%s' for argument %d [153]
@@ -12,11 +12,11 @@ void sink_int_pointer(int *);
 void
 to_function_pointer(int *x)
 {
-	sink_function_pointer(x);
+	sink_function_pointer(x);	/* expect: 153 */
 }
 
 void
 to_int_pointer(unary_operator op)
 {
-	sink_int_pointer(op);
+	sink_int_pointer(op);		/* expect: 153 */
 }
Index: src/tests/usr.bin/xlint/lint1/msg_229.c
diff -u src/tests/usr.bin/xlint/lint1/msg_229.c:1.4 src/tests/usr.bin/xlint/lint1/msg_229.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_229.c:1.4	Sun Feb 28 01:06:57 2021
+++ src/tests/usr.bin/xlint/lint1/msg_229.c	Sun Feb 28 01:20:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_229.c,v 1.4 2021/02/28 01:06:57 rillig Exp $	*/
+/*	$NetBSD: msg_229.c,v 1.5 2021/02/28 01:20:54 rillig Exp $	*/
 # 3 "msg_229.c"
 
 // Test for message: converting '%s' to '%s' is questionable [229]
@@ -8,11 +8,11 @@ typedef double (*unary_operator)(double)
 int *
 to_int_pointer(unary_operator op)
 {
-	return (int *)op;
+	return (int *)op;		/* expect: 229 */
 }
 
 unary_operator
 to_function_pointer(int *p)
 {
-	return (unary_operator)p;
+	return (unary_operator)p;	/* expect: 229 */
 }



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 01:20:54 UTC 2021

Modified Files:
src/tests/usr.bin/xlint: check-expect.lua
src/tests/usr.bin/xlint/lint1: msg_135.c msg_153.c msg_229.c

Log Message:
tests/lint: force 'expect' annotations


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/check-expect.lua
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_135.c \
src/tests/usr.bin/xlint/lint1/msg_153.c \
src/tests/usr.bin/xlint/lint1/msg_229.c

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



CVS commit: src

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 01:06:57 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_153.c msg_153.exp msg_229.c
msg_229.exp
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: make messages for incompatible pointers more specific

Message 153 didn't state obviously which of the pointer types was the
one before conversion (or cast) and which was the resulting type.

Message 229 didn't have any type information at all.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_153.c \
src/tests/usr.bin/xlint/lint1/msg_229.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_153.exp \
src/tests/usr.bin/xlint/lint1/msg_229.exp
cvs rdiff -u -r1.82 -r1.83 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.222 -r1.223 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-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 01:06:57 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_153.c msg_153.exp msg_229.c
msg_229.exp
src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: make messages for incompatible pointers more specific

Message 153 didn't state obviously which of the pointer types was the
one before conversion (or cast) and which was the resulting type.

Message 229 didn't have any type information at all.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_153.c \
src/tests/usr.bin/xlint/lint1/msg_229.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_153.exp \
src/tests/usr.bin/xlint/lint1/msg_229.exp
cvs rdiff -u -r1.82 -r1.83 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.222 -r1.223 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_153.c
diff -u src/tests/usr.bin/xlint/lint1/msg_153.c:1.3 src/tests/usr.bin/xlint/lint1/msg_153.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_153.c:1.3	Sun Feb 28 00:52:16 2021
+++ src/tests/usr.bin/xlint/lint1/msg_153.c	Sun Feb 28 01:06:57 2021
@@ -1,15 +1,22 @@
-/*	$NetBSD: msg_153.c,v 1.3 2021/02/28 00:52:16 rillig Exp $	*/
+/*	$NetBSD: msg_153.c,v 1.4 2021/02/28 01:06:57 rillig Exp $	*/
 # 3 "msg_153.c"
 
-// Test for message: argument has incompatible pointer type, arg #%d (%s != %s) [153]
+// Test for message: converting '%s' to incompatible '%s' for argument %d [153]
 
 
 typedef double (*unary_operator)(double);
 
-void sink_unary_operator(unary_operator);
+void sink_function_pointer(unary_operator);
+void sink_int_pointer(int *);
 
 void
-example(int x)
+to_function_pointer(int *x)
 {
-	sink_unary_operator();
+	sink_function_pointer(x);
+}
+
+void
+to_int_pointer(unary_operator op)
+{
+	sink_int_pointer(op);
 }
Index: src/tests/usr.bin/xlint/lint1/msg_229.c
diff -u src/tests/usr.bin/xlint/lint1/msg_229.c:1.3 src/tests/usr.bin/xlint/lint1/msg_229.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_229.c:1.3	Sun Feb 28 00:52:16 2021
+++ src/tests/usr.bin/xlint/lint1/msg_229.c	Sun Feb 28 01:06:57 2021
@@ -1,12 +1,18 @@
-/*	$NetBSD: msg_229.c,v 1.3 2021/02/28 00:52:16 rillig Exp $	*/
+/*	$NetBSD: msg_229.c,v 1.4 2021/02/28 01:06:57 rillig Exp $	*/
 # 3 "msg_229.c"
 
-// Test for message: questionable conversion of function pointer [229]
+// Test for message: converting '%s' to '%s' is questionable [229]
 
 typedef double (*unary_operator)(double);
 
 int *
-example(unary_operator op)
+to_int_pointer(unary_operator op)
 {
 	return (int *)op;
 }
+
+unary_operator
+to_function_pointer(int *p)
+{
+	return (unary_operator)p;
+}

Index: src/tests/usr.bin/xlint/lint1/msg_153.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_153.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_153.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_153.exp:1.2	Sun Feb 28 00:52:16 2021
+++ src/tests/usr.bin/xlint/lint1/msg_153.exp	Sun Feb 28 01:06:57 2021
@@ -1 +1,2 @@
-msg_153.c(14): warning: argument has incompatible pointer type, arg #1 (pointer to function(double) returning double != pointer to int) [153]
+msg_153.c(15): warning: converting 'pointer to int' to incompatible 'pointer to function(double) returning double' for argument 1 [153]
+msg_153.c(21): warning: converting 'pointer to function(double) returning double' to incompatible 'pointer to int' for argument 1 [153]
Index: src/tests/usr.bin/xlint/lint1/msg_229.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_229.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_229.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_229.exp:1.2	Sun Feb 28 00:52:16 2021
+++ src/tests/usr.bin/xlint/lint1/msg_229.exp	Sun Feb 28 01:06:57 2021
@@ -1 +1,2 @@
-msg_229.c(11): warning: questionable conversion of function pointer [229]
+msg_229.c(11): warning: converting 'pointer to function(double) returning double' to 'pointer to int' is questionable [229]
+msg_229.c(17): warning: converting 'pointer to int' to 'pointer to function(double) returning double' is questionable [229]

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.82 src/usr.bin/xlint/lint1/err.c:1.83
--- src/usr.bin/xlint/lint1/err.c:1.82	Sun Feb 28 00:40:22 2021
+++ src/usr.bin/xlint/lint1/err.c	Sun Feb 28 01:06:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.82 2021/02/28 00:40:22 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.83 2021/02/28 01:06:57 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.82 2021/02/28 00:40:22 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.83 2021/02/28 01:06:57 rillig Exp $");
 #endif
 
 #include 
@@ -212,7 +212,7 @@ const	char *msgs[] = {
 	"argument mismatch: %d arg%s passed, %d expected",	  /* 150 */
 	"void expressions may not be arguments, arg #%d",	  /* 

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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 00:52:16 UTC 2021

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

Log Message:
tests/lint: add tests for function pointers


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_153.c \
src/tests/usr.bin/xlint/lint1/msg_229.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_153.exp \
src/tests/usr.bin/xlint/lint1/msg_229.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_153.c
diff -u src/tests/usr.bin/xlint/lint1/msg_153.c:1.2 src/tests/usr.bin/xlint/lint1/msg_153.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_153.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_153.c	Sun Feb 28 00:52:16 2021
@@ -1,7 +1,15 @@
-/*	$NetBSD: msg_153.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_153.c,v 1.3 2021/02/28 00:52:16 rillig Exp $	*/
 # 3 "msg_153.c"
 
 // Test for message: argument has incompatible pointer type, arg #%d (%s != %s) [153]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+
+typedef double (*unary_operator)(double);
+
+void sink_unary_operator(unary_operator);
+
+void
+example(int x)
+{
+	sink_unary_operator();
+}
Index: src/tests/usr.bin/xlint/lint1/msg_229.c
diff -u src/tests/usr.bin/xlint/lint1/msg_229.c:1.2 src/tests/usr.bin/xlint/lint1/msg_229.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_229.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_229.c	Sun Feb 28 00:52:16 2021
@@ -1,7 +1,12 @@
-/*	$NetBSD: msg_229.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_229.c,v 1.3 2021/02/28 00:52:16 rillig Exp $	*/
 # 3 "msg_229.c"
 
 // Test for message: questionable conversion of function pointer [229]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+typedef double (*unary_operator)(double);
+
+int *
+example(unary_operator op)
+{
+	return (int *)op;
+}

Index: src/tests/usr.bin/xlint/lint1/msg_153.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_153.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_153.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_153.exp:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_153.exp	Sun Feb 28 00:52:16 2021
@@ -1 +1 @@
-msg_153.c(6): syntax error ':' [249]
+msg_153.c(14): warning: argument has incompatible pointer type, arg #1 (pointer to function(double) returning double != pointer to int) [153]
Index: src/tests/usr.bin/xlint/lint1/msg_229.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_229.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_229.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_229.exp:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_229.exp	Sun Feb 28 00:52:16 2021
@@ -1 +1 @@
-msg_229.c(6): syntax error ':' [249]
+msg_229.c(11): warning: questionable conversion of function pointer [229]



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 00:52:16 UTC 2021

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

Log Message:
tests/lint: add tests for function pointers


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

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



CVS commit: src/usr.bin/resize

2021-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 28 00:44:58 UTC 2021

Modified Files:
src/usr.bin/resize: resize.h

Log Message:
add parens


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/resize/resize.h

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/resize/resize.h
diff -u src/usr.bin/resize/resize.h:1.1 src/usr.bin/resize/resize.h:1.2
--- src/usr.bin/resize/resize.h:1.1	Sat Feb 27 10:36:39 2021
+++ src/usr.bin/resize/resize.h	Sat Feb 27 19:44:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: resize.h,v 1.1 2021/02/27 15:36:39 christos Exp $	*/
+/*	$NetBSD: resize.h,v 1.2 2021/02/28 00:44:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
 #define TTYSIZE_STRUCT struct winsize
 #define TTYSIZE_ROWS(ws) (ws).ws_row
 #define TTYSIZE_COLS(ws) (ws).ws_col
-#define SET_TTYSIZE(fd, ws) ioctl((fd), TIOCSWINSZ, )
+#define SET_TTYSIZE(fd, ws) ioctl((fd), TIOCSWINSZ, &(ws))
 
 #define x_basename(a) basename(a)
 #define x_strdup(a) estrdup(a)



CVS commit: src/usr.bin/resize

2021-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 28 00:44:58 UTC 2021

Modified Files:
src/usr.bin/resize: resize.h

Log Message:
add parens


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/resize/resize.h

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



CVS commit: src/usr.bin/resize

2021-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 28 00:43:24 UTC 2021

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

Log Message:
no need to specify SRCS


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/resize/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/resize/Makefile
diff -u src/usr.bin/resize/Makefile:1.4 src/usr.bin/resize/Makefile:1.5
--- src/usr.bin/resize/Makefile:1.4	Sat Feb 27 17:37:54 2021
+++ src/usr.bin/resize/Makefile	Sat Feb 27 19:43:24 2021
@@ -1,10 +1,9 @@
-#	$NetBSD: Makefile,v 1.4 2021/02/27 22:37:54 christos Exp $
+#	$NetBSD: Makefile,v 1.5 2021/02/28 00:43:24 christos Exp $
 
 .include 
 
 WARNS=	5
 PROG=	resize
-SRCS=	resize.c
 
 CPPFLAGS+=-DRESIZE_ONLY -Wno-format-nonliteral
 DPADD+=	${LIBUTIL}



CVS commit: src/usr.bin/resize

2021-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 28 00:43:24 UTC 2021

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

Log Message:
no need to specify SRCS


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/resize/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/resize

2021-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 28 00:42:22 UTC 2021

Removed Files:
src/usr.bin/resize: xstrings.c xstrings.h

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/usr.bin/resize/xstrings.c \
src/usr.bin/resize/xstrings.h

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



CVS commit: src/usr.bin/resize

2021-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 28 00:42:22 UTC 2021

Removed Files:
src/usr.bin/resize: xstrings.c xstrings.h

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/usr.bin/resize/xstrings.c \
src/usr.bin/resize/xstrings.h

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



CVS commit: src

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 00:40:22 UTC 2021

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

Log Message:
lint: add type information to 'possible pointer alignment problem [135]'

This warning occurs more than 7400 times in a regular NetBSD build, and
without giving any type information, leaves the reader clueless about
what the underlying issue might be.  Add type information since that is
a no-brainer to implement.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_135.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_135.exp
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.221 -r1.222 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_135.c
diff -u src/tests/usr.bin/xlint/lint1/msg_135.c:1.3 src/tests/usr.bin/xlint/lint1/msg_135.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_135.c:1.3	Sun Feb 28 00:20:19 2021
+++ src/tests/usr.bin/xlint/lint1/msg_135.c	Sun Feb 28 00:40:22 2021
@@ -1,7 +1,7 @@
-/*	$NetBSD: msg_135.c,v 1.3 2021/02/28 00:20:19 rillig Exp $	*/
+/*	$NetBSD: msg_135.c,v 1.4 2021/02/28 00:40:22 rillig Exp $	*/
 # 3 "msg_135.c"
 
-// Test for message: possible pointer alignment problem [135]
+// Test for message: converting '%s' to '%s' may cause alignment problem [135]
 
 /* lint1-extra-flags: -h */
 

Index: src/tests/usr.bin/xlint/lint1/msg_135.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_135.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_135.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_135.exp:1.2	Sun Feb 28 00:20:19 2021
+++ src/tests/usr.bin/xlint/lint1/msg_135.exp	Sun Feb 28 00:40:22 2021
@@ -1 +1 @@
-msg_135.c(13): warning: possible pointer alignment problem [135]
+msg_135.c(13): warning: converting 'pointer to const unsigned char' to 'pointer to const unsigned int' may cause alignment problem [135]

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.81 src/usr.bin/xlint/lint1/err.c:1.82
--- src/usr.bin/xlint/lint1/err.c:1.81	Mon Feb 22 15:09:50 2021
+++ src/usr.bin/xlint/lint1/err.c	Sun Feb 28 00:40:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.81 2021/02/22 15:09:50 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.82 2021/02/28 00:40:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.81 2021/02/22 15:09:50 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.82 2021/02/28 00:40:22 rillig Exp $");
 #endif
 
 #include 
@@ -194,7 +194,7 @@ const	char *msgs[] = {
 	"conversion from '%s' to '%s' may lose accuracy",	  /* 132 */
 	"conversion of pointer to '%s' loses bits",		  /* 133 */
 	"conversion of pointer to '%s' may lose bits",		  /* 134 */
-	"possible pointer alignment problem",			  /* 135 */
+	"converting '%s' to '%s' may cause alignment problem",	  /* 135 */
 	"cannot do pointer arithmetic on operand of unknown size",/* 136 */
 	"use of incomplete enum type, op %s",			  /* 137 */
 	"unknown operand size, op %s",  /* 138 */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.221 src/usr.bin/xlint/lint1/tree.c:1.222
--- src/usr.bin/xlint/lint1/tree.c:1.221	Sun Feb 28 00:28:47 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Feb 28 00:40:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.221 2021/02/28 00:28:47 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.222 2021/02/28 00:40:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.221 2021/02/28 00:28:47 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.222 2021/02/28 00:40:22 rillig Exp $");
 #endif
 
 #include 
@@ -2245,8 +2245,8 @@ check_pointer_conversion(op_t op, tnode_
 
 	if (hflag && alignment_in_bits(tp->t_subt) >
 		 alignment_in_bits(tn->tn_type->t_subt)) {
-		/* possible pointer alignment problem */
-		warning(135);
+		/* converting '%s' to '%s' may cause alignment problem */
+		warning(135, type_name(tn->tn_type), type_name(tp));
 	}
 
 	if (((nt == STRUCT || nt == UNION) &&



CVS commit: src

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 00:40:22 UTC 2021

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

Log Message:
lint: add type information to 'possible pointer alignment problem [135]'

This warning occurs more than 7400 times in a regular NetBSD build, and
without giving any type information, leaves the reader clueless about
what the underlying issue might be.  Add type information since that is
a no-brainer to implement.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_135.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_135.exp
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.221 -r1.222 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-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 00:28:47 UTC 2021

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

Log Message:
lint: skip alignment computation if possible

Testing a global variable is simpler than calling a 20-line function.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 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/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.220 src/usr.bin/xlint/lint1/tree.c:1.221
--- src/usr.bin/xlint/lint1/tree.c:1.220	Sun Feb 28 00:23:55 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Feb 28 00:28:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.220 2021/02/28 00:23:55 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.221 2021/02/28 00:28:47 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.220 2021/02/28 00:23:55 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.221 2021/02/28 00:28:47 rillig Exp $");
 #endif
 
 #include 
@@ -2243,12 +2243,12 @@ check_pointer_conversion(op_t op, tnode_
 		return;
 	}
 
-	if (alignment_in_bits(tp->t_subt) >
-	alignment_in_bits(tn->tn_type->t_subt)) {
-		if (hflag)
-			/* possible pointer alignment problem */
-			warning(135);
+	if (hflag && alignment_in_bits(tp->t_subt) >
+		 alignment_in_bits(tn->tn_type->t_subt)) {
+		/* possible pointer alignment problem */
+		warning(135);
 	}
+
 	if (((nt == STRUCT || nt == UNION) &&
 	 tp->t_subt->t_str != tn->tn_type->t_subt->t_str) ||
 	psize(nt) != psize(ot)) {



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 00:28:47 UTC 2021

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

Log Message:
lint: skip alignment computation if possible

Testing a global variable is simpler than calling a 20-line function.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 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-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 00:23:55 UTC 2021

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

Log Message:
lint: rename getbound to alignment_in_bits

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.219 -r1.220 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.138 src/usr.bin/xlint/lint1/decl.c:1.139
--- src/usr.bin/xlint/lint1/decl.c:1.138	Mon Feb 22 15:09:50 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sun Feb 28 00:23:55 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.138 2021/02/22 15:09:50 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.139 2021/02/28 00:23: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.138 2021/02/22 15:09:50 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.139 2021/02/28 00:23:55 rillig Exp $");
 #endif
 
 #include 
@@ -925,11 +925,8 @@ length(const type_t *tp, const char *nam
 	return elem * elsz;
 }
 
-/*
- * Get the alignment of the given Type in bits.
- */
 int
-getbound(const type_t *tp)
+alignment_in_bits(const type_t *tp)
 {
 	size_t	a;
 	tspec_t	t;
@@ -1177,12 +1174,12 @@ declarator_1_struct_union(sym_t *dsym)
 		dcs->d_offset = 0;
 	}
 	if (dsym->s_bitfield) {
-		align(getbound(tp), tp->t_flen);
+		align(alignment_in_bits(tp), tp->t_flen);
 		dsym->s_value.v_quad = (dcs->d_offset / size(t)) * size(t);
 		tp->t_foffs = dcs->d_offset - (int)dsym->s_value.v_quad;
 		dcs->d_offset += tp->t_flen;
 	} else {
-		align(getbound(tp), 0);
+		align(alignment_in_bits(tp), 0);
 		dsym->s_value.v_quad = dcs->d_offset;
 		dcs->d_offset += sz;
 	}

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.71 src/usr.bin/xlint/lint1/externs1.h:1.72
--- src/usr.bin/xlint/lint1/externs1.h:1.71	Sun Feb 21 15:02:16 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sun Feb 28 00:23:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.71 2021/02/21 15:02:16 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.72 2021/02/28 00:23:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -154,7 +154,7 @@ extern	void	setasm(void);
 extern	void	clrtyp(void);
 extern	void	deftyp(void);
 extern	int	length(const type_t *, const char *);
-extern	int	getbound(const type_t *);
+extern	int	alignment_in_bits(const type_t *);
 extern	sym_t	*lnklst(sym_t *, sym_t *);
 extern	void	check_type(sym_t *);
 extern	sym_t	*declarator_1_struct_union(sym_t *);

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.219 src/usr.bin/xlint/lint1/tree.c:1.220
--- src/usr.bin/xlint/lint1/tree.c:1.219	Sat Feb 27 15:26:30 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Feb 28 00:23:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.219 2021/02/27 15:26:30 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.220 2021/02/28 00:23: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.219 2021/02/27 15:26:30 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.220 2021/02/28 00:23:55 rillig Exp $");
 #endif
 
 #include 
@@ -2243,7 +2243,8 @@ check_pointer_conversion(op_t op, tnode_
 		return;
 	}
 
-	if (getbound(tp->t_subt) > getbound(tn->tn_type->t_subt)) {
+	if (alignment_in_bits(tp->t_subt) >
+	alignment_in_bits(tn->tn_type->t_subt)) {
 		if (hflag)
 			/* possible pointer alignment problem */
 			warning(135);
@@ -3420,7 +3421,7 @@ build_alignof(type_t *tp)
 	}
 
 	return new_integer_constant_node(SIZEOF_TSPEC,
-	(int64_t)getbound(tp) / CHAR_SIZE);
+	(int64_t)alignment_in_bits(tp) / CHAR_SIZE);
 }
 
 /*



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 00:23:55 UTC 2021

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

Log Message:
lint: rename getbound to alignment_in_bits

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.219 -r1.220 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/tests/usr.bin/xlint/lint1

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 00:20:19 UTC 2021

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

Log Message:
tests/lint: add test for 'possible pointer alignment problem [135]'


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_135.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_135.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_135.c
diff -u src/tests/usr.bin/xlint/lint1/msg_135.c:1.2 src/tests/usr.bin/xlint/lint1/msg_135.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_135.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_135.c	Sun Feb 28 00:20:19 2021
@@ -1,7 +1,16 @@
-/*	$NetBSD: msg_135.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_135.c,v 1.3 2021/02/28 00:20:19 rillig Exp $	*/
 # 3 "msg_135.c"
 
 // Test for message: possible pointer alignment problem [135]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+/* lint1-extra-flags: -h */
+
+unsigned
+read_uint(const unsigned char **pp)
+{
+	unsigned val;
+
+	val = *(const unsigned *)(*pp);
+	pp += sizeof(unsigned);
+	return val;
+}

Index: src/tests/usr.bin/xlint/lint1/msg_135.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_135.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_135.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_135.exp:1.1	Sat Jan  2 10:22:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_135.exp	Sun Feb 28 00:20:19 2021
@@ -1 +1 @@
-msg_135.c(6): syntax error ':' [249]
+msg_135.c(13): warning: possible pointer alignment problem [135]



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Feb 28 00:20:19 UTC 2021

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

Log Message:
tests/lint: add test for 'possible pointer alignment problem [135]'


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

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



CVS commit: src/usr.bin/resize

2021-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 27 22:37:54 UTC 2021

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

Log Message:
Don't define the copy rules if we don't have X sources


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/resize/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/resize

2021-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 27 22:37:54 UTC 2021

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

Log Message:
Don't define the copy rules if we don't have X sources


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/resize/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/resize/Makefile
diff -u src/usr.bin/resize/Makefile:1.3 src/usr.bin/resize/Makefile:1.4
--- src/usr.bin/resize/Makefile:1.3	Sat Feb 27 11:08:08 2021
+++ src/usr.bin/resize/Makefile	Sat Feb 27 17:37:54 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2021/02/27 16:08:08 christos Exp $
+#	$NetBSD: Makefile,v 1.4 2021/02/27 22:37:54 christos Exp $
 
 .include 
 
@@ -14,11 +14,13 @@ LDADD+= -lutil
 
 XTERM=${X11SRCDIR}/external/mit/xterm/dist
 
+.if exists(${XTERM})
 .for i in resize.c resize.man
 copy:: ${.CURDIR}/${i}
 ${.CURDIR}/${i}: ${XTERM}/${i}
 	cp -p ${.ALLSRC} ${.TARGET}
 .endfor
+.endif
 
 CLEANFILES+=resize.1
 



CVS commit: src/external/mit/xorg/bin/xterm/resize

2021-02-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Feb 27 21:13:09 UTC 2021

Removed Files:
src/external/mit/xorg/bin/xterm/resize: Makefile

Log Message:
Clean up file obsoleted by migration to usr.bin/resize.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 src/external/mit/xorg/bin/xterm/resize/Makefile

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



CVS commit: src/external/mit/xorg/bin/xterm/resize

2021-02-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Feb 27 21:13:09 UTC 2021

Removed Files:
src/external/mit/xorg/bin/xterm/resize: Makefile

Log Message:
Clean up file obsoleted by migration to usr.bin/resize.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 src/external/mit/xorg/bin/xterm/resize/Makefile

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-02-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Feb 27 20:43:58 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx: pic_uic.c
src/sys/arch/powerpc/ibm4xx/dev: com_opb.c dwctwo_plb.c ecc_plb.c
if_emac.c mal.c

Log Message:
Switch to intr_establish_xname().


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/ibm4xx/pic_uic.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/ibm4xx/dev/com_opb.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/ibm4xx/dev/ecc_plb.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/powerpc/ibm4xx/dev/if_emac.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/ibm4xx/dev/mal.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/pic_uic.c
diff -u src/sys/arch/powerpc/ibm4xx/pic_uic.c:1.7 src/sys/arch/powerpc/ibm4xx/pic_uic.c:1.8
--- src/sys/arch/powerpc/ibm4xx/pic_uic.c:1.7	Mon Jul  6 10:35:28 2020
+++ src/sys/arch/powerpc/ibm4xx/pic_uic.c	Sat Feb 27 20:43:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic_uic.c,v 1.7 2020/07/06 10:35:28 rin Exp $	*/
+/*	$NetBSD: pic_uic.c,v 1.8 2021/02/27 20:43:58 rin Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic_uic.c,v 1.7 2020/07/06 10:35:28 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_uic.c,v 1.8 2021/02/27 20:43:58 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ppcarch.h"
@@ -217,7 +217,8 @@ extern struct pic_ops pic_uic1;
 static void
 uic1_finish_setup(struct pic_ops *pic)
 {
-	intr_establish(30, IST_LEVEL, IPL_HIGH, pic_handle_intr, _uic1);
+	intr_establish_xname(30, IST_LEVEL, IPL_HIGH, pic_handle_intr,
+	_uic1, "uic1");
 }
 
 struct uic uic1 = {
@@ -272,7 +273,8 @@ extern struct pic_ops pic_uic2;
 static void
 uic2_finish_setup(struct pic_ops *pic)
 {
-	intr_establish(28, IST_LEVEL, IPL_HIGH, pic_handle_intr, _uic2);
+	intr_establish_xname(28, IST_LEVEL, IPL_HIGH, pic_handle_intr,
+	_uic2, "uic2");
 }
 
 static struct uic uic2 = {

Index: src/sys/arch/powerpc/ibm4xx/dev/com_opb.c
diff -u src/sys/arch/powerpc/ibm4xx/dev/com_opb.c:1.24 src/sys/arch/powerpc/ibm4xx/dev/com_opb.c:1.25
--- src/sys/arch/powerpc/ibm4xx/dev/com_opb.c:1.24	Mon Jul  6 09:34:17 2020
+++ src/sys/arch/powerpc/ibm4xx/dev/com_opb.c	Sat Feb 27 20:43:58 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: com_opb.c,v 1.24 2020/07/06 09:34:17 rin Exp $ */
+/* $NetBSD: com_opb.c,v 1.25 2021/02/27 20:43:58 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: com_opb.c,v 1.24 2020/07/06 09:34:17 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_opb.c,v 1.25 2021/02/27 20:43:58 rin Exp $");
 
 #include "com.h"
 
@@ -133,7 +133,8 @@ com_opb_attach(device_t parent, device_t
 
 	com_attach_subr(sc);
 
-	intr_establish(oaa->opb_irq, IST_LEVEL, IPL_SERIAL, comintr, sc);
+	intr_establish_xname(oaa->opb_irq, IST_LEVEL, IPL_SERIAL, comintr, sc,
+	device_xname(self));
 }
 
 /*

Index: src/sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c
diff -u src/sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c:1.5 src/sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c:1.6
--- src/sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c:1.5	Sat Apr 23 10:15:30 2016
+++ src/sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c	Sat Feb 27 20:43:58 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: dwctwo_plb.c,v 1.5 2016/04/23 10:15:30 skrll Exp $ */
+/* $NetBSD: dwctwo_plb.c,v 1.6 2021/02/27 20:43:58 rin Exp $ */
 /*
  * Copyright (c) 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwctwo_plb.c,v 1.5 2016/04/23 10:15:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwctwo_plb.c,v 1.6 2021/02/27 20:43:58 rin Exp $");
 
 #include 
 #include 
@@ -112,7 +112,8 @@ dwctwo_plb_attach(device_t parent, devic
 	bus_space_map(sc->sc_iot, paa->plb_addr, DWCTWO_SIZE, 0, >sc_ioh);
 	sc->sc_bus.ub_dmatag = paa->plb_dmat;
 
-	intr_establish(paa->plb_irq, IST_LEVEL, IPL_VM, dwc2_intr, sc);
+	intr_establish_xname(paa->plb_irq, IST_LEVEL, IPL_VM, dwc2_intr, sc,
+	device_xname(self));
 
 	/* Enable the USB interface. */
 	mtsdr(DCR_SDR0_PFC1, mfsdr(DCR_SDR0_PFC1) | SDR0_PFC1_USBEN);

Index: src/sys/arch/powerpc/ibm4xx/dev/ecc_plb.c
diff -u src/sys/arch/powerpc/ibm4xx/dev/ecc_plb.c:1.15 src/sys/arch/powerpc/ibm4xx/dev/ecc_plb.c:1.16
--- src/sys/arch/powerpc/ibm4xx/dev/ecc_plb.c:1.15	Tue Feb 25 14:09:13 2014
+++ src/sys/arch/powerpc/ibm4xx/dev/ecc_plb.c	Sat Feb 27 20:43:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ecc_plb.c,v 1.15 2014/02/25 14:09:13 martin Exp $	*/
+/*	$NetBSD: ecc_plb.c,v 1.16 2021/02/27 20:43:58 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ecc_plb.c,v 1.15 2014/02/25 14:09:13 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ecc_plb.c,v 1.16 2021/02/27 20:43:58 rin Exp $");
 
 

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

2021-02-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Feb 27 20:43:58 UTC 2021

Modified Files:
src/sys/arch/powerpc/ibm4xx: pic_uic.c
src/sys/arch/powerpc/ibm4xx/dev: com_opb.c dwctwo_plb.c ecc_plb.c
if_emac.c mal.c

Log Message:
Switch to intr_establish_xname().


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/ibm4xx/pic_uic.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/ibm4xx/dev/com_opb.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/ibm4xx/dev/ecc_plb.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/powerpc/ibm4xx/dev/if_emac.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/ibm4xx/dev/mal.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/sparc64/doc

2021-02-27 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Feb 27 18:29:38 UTC 2021

Modified Files:
src/sys/arch/sparc64/doc: TODO

Log Message:
sun4v: update TODO file with OpenFirmware interface related improvements


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sparc64/doc/TODO

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/sparc64/doc/TODO
diff -u src/sys/arch/sparc64/doc/TODO:1.35 src/sys/arch/sparc64/doc/TODO:1.36
--- src/sys/arch/sparc64/doc/TODO:1.35	Sat Feb 27 18:19:57 2021
+++ src/sys/arch/sparc64/doc/TODO	Sat Feb 27 18:29:38 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO,v 1.35 2021/02/27 18:19:57 palle Exp $ */
+/* $NetBSD: TODO,v 1.36 2021/02/27 18:29:38 palle Exp $ */
 
 Things to be done:
 
@@ -41,6 +41,19 @@ sun4v:
 - vdsk and ldc drivers: code maked with OPENBSD_BUSDMA - make the bus_dma stuff work properly
 - vbus.c: handle prom_getprop() memory leaks
 - locore.s: rft_user (sun4v specific manaul fill) - seems to work, but is it good enough (compared to openbsds rft_user?
+- openfirmware interface
+bounce handlng could need rework
+  - only #if __arch64__ independent for SUN4V, as OF for all ultrasparcs is
+plain 32bit code too (and this #if only because the point below becomes
+always false otherwise)
+  - only bounce if the address is >= 1UL<<32
+  - perhaps apply the lock to OF calls in general, not only the bounce'd ones
+(in other words: let's protect the OF context with the lock, not
+only the bounce buffer contents).
+	  - Are there any other bounce-worthy OF calls? If so, apply handling 
+	to all of them now
+  - consider method used by Solaris/OpenSolaris/Illumos (look for PROM_32BIT_ADDRS in
+	the Illumos codebase)
  - platforms tested so far:
  -- qemu sun4v/niagara - reaches the point where the kernel needs to mount a root fs
  -- T2000 - mmu fault somewhere



CVS commit: src/sys/arch/sparc64/doc

2021-02-27 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Feb 27 18:29:38 UTC 2021

Modified Files:
src/sys/arch/sparc64/doc: TODO

Log Message:
sun4v: update TODO file with OpenFirmware interface related improvements


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sparc64/doc/TODO

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



CVS commit: src/sys/arch/sparc64/doc

2021-02-27 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Feb 27 18:19:57 UTC 2021

Modified Files:
src/sys/arch/sparc64/doc: TODO

Log Message:
sun4v: update TODO file with status on sun4v - kernel and userland runs without 
crashing now - next up is network interfaces


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/sparc64/doc/TODO

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/sparc64/doc/TODO
diff -u src/sys/arch/sparc64/doc/TODO:1.34 src/sys/arch/sparc64/doc/TODO:1.35
--- src/sys/arch/sparc64/doc/TODO:1.34	Mon Feb 22 10:30:57 2021
+++ src/sys/arch/sparc64/doc/TODO	Sat Feb 27 18:19:57 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO,v 1.34 2021/02/22 10:30:57 palle Exp $ */
+/* $NetBSD: TODO,v 1.35 2021/02/27 18:19:57 palle Exp $ */
 
 Things to be done:
 
@@ -14,8 +14,10 @@ sun4v:
  - current status
  T5 ldom with 2 VCPU and 4GB:
The kernel boots and starts userland when booting miniroot.fs.
-   The sysinst tool starts properly and requests terminal type.
-	   Upon entering characters on the console, a crash occurs inside
+   The sysinst tool starts properly and is functional.
+	   Installation is not possible, since no driver currently exists
+	   for the ldom network interfaces, but openbsd vnet and vsw drivers are
+	   possible to integrate and this work is progressing.
 	   OpenBoot (properly trashed registers).
 	 T2000 ldom with 8 VCPU and 4GB:
 	   On this platform it crashes in /sbin/init doing an access() call where %o0 is corrupted (zero)



CVS commit: src/sys/arch/sparc64/doc

2021-02-27 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Feb 27 18:19:57 UTC 2021

Modified Files:
src/sys/arch/sparc64/doc: TODO

Log Message:
sun4v: update TODO file with status on sun4v - kernel and userland runs without 
crashing now - next up is network interfaces


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/sparc64/doc/TODO

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



CVS commit: src/sys/arch/sparc/sparc

2021-02-27 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Feb 27 18:10:46 UTC 2021

Modified Files:
src/sys/arch/sparc/sparc: openfirm.c

Log Message:
sun4v: add 32/64 bit workaround for the OF_read() call, similar to the one 
introduced in revision 1.21


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sparc/sparc/openfirm.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/sparc/sparc/openfirm.c
diff -u src/sys/arch/sparc/sparc/openfirm.c:1.23 src/sys/arch/sparc/sparc/openfirm.c:1.24
--- src/sys/arch/sparc/sparc/openfirm.c:1.23	Sun Mar 26 12:38:24 2017
+++ src/sys/arch/sparc/sparc/openfirm.c	Sat Feb 27 18:10:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: openfirm.c,v 1.23 2017/03/26 12:38:24 martin Exp $	*/
+/*	$NetBSD: openfirm.c,v 1.24 2021/02/27 18:10:46 palle Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: openfirm.c,v 1.23 2017/03/26 12:38:24 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: openfirm.c,v 1.24 2021/02/27 18:10:46 palle Exp $");
 
 #include 
 #include 
@@ -503,6 +503,15 @@ OF_read(int handle, void *addr, int len)
 	} args;
 	int l, act = 0;
 
+#ifdef SUN4V
+#if __arch64__
+	void *oaddr = addr;
+	__cpu_simple_lock(_lock);
+	if (len > OFBOUNCE_MAXSIZE) 
+		panic("OF_read(len = %d) exceedes bounce buffer\n", len);
+	addr = ofbounce;
+#endif	
+#endif
 	args.name = ADR2CELL("read");
 	args.nargs = 3;
 	args.nreturns = 1;
@@ -511,18 +520,31 @@ OF_read(int handle, void *addr, int len)
 	for (; len > 0; len -= l) {
 		l = MIN(NBPG, len);
 		args.len = l;
-		if (openfirmware() == -1)
-			return -1;
+		if (openfirmware() == -1) {
+			act = -1;
+			goto OF_read_exit;
+		}
 		if (args.actual > 0) {
 			act += args.actual;
 		}
 		if (args.actual < l) {
 			if (act)
-return act;
-			else
-return args.actual;
+goto OF_read_exit;
+			else {
+act = args.actual;	
+goto OF_read_exit;
+			}
 		}
 	}
+OF_read_exit:
+#ifdef SUN4V
+#if __arch64__
+	if (act > 0) {
+		memcpy(oaddr, addr, act);	
+	}
+	__cpu_simple_unlock(_lock);
+#endif
+#endif
 	return act;
 }
 



CVS commit: src/sys/arch/sparc/sparc

2021-02-27 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Feb 27 18:10:46 UTC 2021

Modified Files:
src/sys/arch/sparc/sparc: openfirm.c

Log Message:
sun4v: add 32/64 bit workaround for the OF_read() call, similar to the one 
introduced in revision 1.21


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sparc/sparc/openfirm.c

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



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 27 18:01:29 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_242.c msg_242.exp msg_277.c
msg_277.exp msg_278.c msg_278.exp msg_279.c msg_279.exp

Log Message:
tests/lint: add tests for enum/int mismatch


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_242.c \
src/tests/usr.bin/xlint/lint1/msg_278.c \
src/tests/usr.bin/xlint/lint1/msg_279.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_242.exp \
src/tests/usr.bin/xlint/lint1/msg_277.exp \
src/tests/usr.bin/xlint/lint1/msg_278.exp \
src/tests/usr.bin/xlint/lint1/msg_279.exp
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_277.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_242.c
diff -u src/tests/usr.bin/xlint/lint1/msg_242.c:1.2 src/tests/usr.bin/xlint/lint1/msg_242.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_242.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_242.c	Sat Feb 27 18:01:29 2021
@@ -1,7 +1,27 @@
-/*	$NetBSD: msg_242.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_242.c,v 1.3 2021/02/27 18:01:29 rillig Exp $	*/
 # 3 "msg_242.c"
 
 // Test for message: combination of '%s' and '%s', op %s [242]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+/* lint1-extra-flags: -e */
+
+enum E {
+	E1
+};
+
+void sink_enum(enum E);
+void sink_int(int);
+
+void
+example(enum E e, int i)
+{
+	enum E e2 = e;
+	enum E e3 = i;		/* expect: 242 */
+	int i2 = e;		/* expect: 242 */
+	int i3 = i;
+
+	sink_enum(e2);
+	sink_enum(e3);
+	sink_int(i2);
+	sink_int(i3);
+}
Index: src/tests/usr.bin/xlint/lint1/msg_278.c
diff -u src/tests/usr.bin/xlint/lint1/msg_278.c:1.2 src/tests/usr.bin/xlint/lint1/msg_278.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_278.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_278.c	Sat Feb 27 18:01:29 2021
@@ -1,7 +1,23 @@
-/*	$NetBSD: msg_278.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_278.c,v 1.3 2021/02/27 18:01:29 rillig Exp $	*/
 # 3 "msg_278.c"
 
 // Test for message: combination of '%s' and '%s', arg #%d [278]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+/* lint1-extra-flags: -e */
+
+enum E {
+	E1
+};
+
+void sink_enum(enum E);
+void sink_int(int);
+
+void
+example(enum E e, int i)
+{
+	sink_enum(e);
+	sink_enum(i);		/* expect: 278 */
+
+	sink_int(e);		/* expect: 278 */
+	sink_int(i);
+}
Index: src/tests/usr.bin/xlint/lint1/msg_279.c
diff -u src/tests/usr.bin/xlint/lint1/msg_279.c:1.2 src/tests/usr.bin/xlint/lint1/msg_279.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_279.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_279.c	Sat Feb 27 18:01:29 2021
@@ -1,7 +1,25 @@
-/*	$NetBSD: msg_279.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_279.c,v 1.3 2021/02/27 18:01:29 rillig Exp $	*/
 # 3 "msg_279.c"
 
 // Test for message: combination of '%s' and '%s' in return [279]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+/* lint1-extra-flags: -e */
+
+enum E {
+	E1
+};
+
+void sink_enum(enum E);
+void sink_int(int);
+
+enum E
+returning_enum(int i)
+{
+	return i;		/* expect: 279 */
+}
+
+int
+returning_int(enum E e)
+{
+	return e;		/* expect: 279 */
+}

Index: src/tests/usr.bin/xlint/lint1/msg_242.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_242.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_242.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_242.exp:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_242.exp	Sat Feb 27 18:01:29 2021
@@ -1 +1,2 @@
-msg_242.c(6): syntax error ':' [249]
+msg_242.c(19): warning: combination of 'enum E' and 'int', op = [242]
+msg_242.c(20): warning: combination of 'int' and 'enum E', op = [242]
Index: src/tests/usr.bin/xlint/lint1/msg_277.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_277.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_277.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_277.exp:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_277.exp	Sat Feb 27 18:01:29 2021
@@ -1 +1,2 @@
-msg_277.c(6): syntax error ':' [249]
+msg_277.c(19): warning: initialization of 'enum E' with 'int' [277]
+msg_277.c(20): warning: initialization of 'int' with 'enum E' [277]
Index: src/tests/usr.bin/xlint/lint1/msg_278.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_278.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_278.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_278.exp:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_278.exp	Sat Feb 27 18:01:29 2021
@@ -1 +1,2 @@
-msg_278.c(6): syntax error ':' [249]

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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 27 18:01:29 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_242.c msg_242.exp msg_277.c
msg_277.exp msg_278.c msg_278.exp msg_279.c msg_279.exp

Log Message:
tests/lint: add tests for enum/int mismatch


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_242.c \
src/tests/usr.bin/xlint/lint1/msg_278.c \
src/tests/usr.bin/xlint/lint1/msg_279.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_242.exp \
src/tests/usr.bin/xlint/lint1/msg_277.exp \
src/tests/usr.bin/xlint/lint1/msg_278.exp \
src/tests/usr.bin/xlint/lint1/msg_279.exp
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_277.c

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



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 27 17:16:48 UTC 2021

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

Log Message:
tests/lint: allow 'expect' comments to refer to other lines

This allows /* expect+1: ... */ to refer to the following line, as well
as /* expect-1: ... */ to refer to the previous line.  This avoids
horizontal scrolling to see the expectations, it also allows these
expectations comments to be more verbose, mentioning the whole
diagnostic in many cases.

The 'expect' comments don't need to be at the end of a line anymore
since that was rather surprising.  The one 'expect' comment that had not
been at the end of the line was in d_c99_bool_strict.c and was not
intended to be ignored.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/check-expect.lua
cvs rdiff -u -r1.21 -r1.22 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c

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



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 27 17:16:48 UTC 2021

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

Log Message:
tests/lint: allow 'expect' comments to refer to other lines

This allows /* expect+1: ... */ to refer to the following line, as well
as /* expect-1: ... */ to refer to the previous line.  This avoids
horizontal scrolling to see the expectations, it also allows these
expectations comments to be more verbose, mentioning the whole
diagnostic in many cases.

The 'expect' comments don't need to be at the end of a line anymore
since that was rather surprising.  The one 'expect' comment that had not
been at the end of the line was in d_c99_bool_strict.c and was not
intended to be ignored.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/check-expect.lua
cvs rdiff -u -r1.21 -r1.22 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.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/check-expect.lua
diff -u src/tests/usr.bin/xlint/check-expect.lua:1.4 src/tests/usr.bin/xlint/check-expect.lua:1.5
--- src/tests/usr.bin/xlint/check-expect.lua:1.4	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/check-expect.lua	Sat Feb 27 17:16:48 2021
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.4 2021/02/21 09:07:58 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.5 2021/02/27 17:16:48 rillig Exp $
 
 --[[
 
@@ -28,19 +28,32 @@ end
 local function load_expect_comments_from_c(fname, errors)
 
   local lines = load_lines(fname)
-  if lines == nil then return nil end
+  if lines == nil then return nil, nil end
+
+  local comment_linenos = {}
+  local comments_by_lineno = {}
+  local function add_expectation(lineno, msg)
+if comments_by_lineno[lineno] == nil then
+  table.insert(comment_linenos, lineno)
+  comments_by_lineno[lineno] = {}
+end
+local trimmed_msg = msg:match("^%s*(.-)%s*$")
+table.insert(comments_by_lineno[lineno], trimmed_msg)
+  end
 
-  local comments_by_line = {}
-  local seen_comment = false
   for lineno, line in ipairs(lines) do
-local comments_in_line = {}
-for comments in line:gmatch("/%* expect: (.-) %*/$") do
+
+for offset, comments in line:gmatch("/%* expect([+%-]%d+): (.-) %*/") do
   for comment in comments:gmatch("[^,]+") do
-	table.insert(comments_in_line, comment:match("^%s*(.-)%s*$"))
-seen_comment = true
+add_expectation(lineno + tonumber(offset), comment)
+  end
+end
+
+for comments in line:gmatch("/%* expect: (.-) %*/") do
+  for comment in comments:gmatch("[^,]+") do
+	add_expectation(lineno, comment)
   end
 end
-comments_by_line[lineno] = comments_in_line
 
 local pp_lineno, pp_fname = line:match("^#%s*(%d+)%s+\"([^\"]+)\"")
 if pp_lineno ~= nil then
@@ -51,7 +64,7 @@ local function load_expect_comments_from
 end
   end
 
-  return comments_by_line
+  return comment_linenos, comments_by_lineno
 end
 
 
@@ -77,31 +90,20 @@ end
 
 local function check_test(c_fname, errors)
   local exp_fname = c_fname:gsub("%.c$", ".exp")
-  local comments = load_expect_comments_from_c(c_fname, errors)
-  if comments == nil or #comments == 0 then return end
+  local comment_linenos, comments_by_lineno =
+load_expect_comments_from_c(c_fname, errors)
+  if comment_linenos == nil or #comment_linenos == 0 then return end
   local messages = load_actual_messages_from_exp(exp_fname)
   if messages == nil then return end
 
-  local remaining = 0
-  for lineno, exps in ipairs(comments) do
-for _, msg in ipairs(exps) do
-  -- print("comment", lineno, msg)
-  remaining = remaining + 1
-end
-  end
-
   for _, act in ipairs(messages) do
--- print("messages", act.exp_lineno, act.c_lineno, act.msg)
-
-local exp = comments[act.c_lineno] or {}
+local exp = comments_by_lineno[act.c_lineno] or {}
 
 local found = false
 for i, msg in ipairs(exp) do
   if msg ~= "" and act.msg:find(msg, 1, true) then
 exp[i] = ""
 found = true
-remaining = remaining - 1
--- print("found", act.c_lineno, act.msg, msg, remaining)
 break
   end
 end
@@ -112,10 +114,11 @@ local function check_test(c_fname, error
 end
   end
 
-  for lineno, exps in ipairs(comments) do
-for _, msg in ipairs(exps) do
+  for _, lineno in ipairs(comment_linenos) do
+for _, msg in ipairs(comments_by_lineno[lineno]) do
   if msg ~= "" then
-errors:add("error: %s:%d: declared message \"%s\" is not in the actual output",
+errors:add(
+  "error: %s:%d: declared message \"%s\" is not in the actual output",
   c_fname, lineno, msg)
   end
 end

Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
diff -u 

CVS commit: xsrc/external/mit/ctwm/dist

2021-02-27 Thread Michael van Elst
Module Name:xsrc
Committed By:   mlelstv
Date:   Sat Feb 27 16:20:15 UTC 2021

Modified Files:
xsrc/external/mit/ctwm/dist: add_window.c

Log Message:
Use font height to compute height of resize popup for placing a window.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 xsrc/external/mit/ctwm/dist/add_window.c

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

Modified files:

Index: xsrc/external/mit/ctwm/dist/add_window.c
diff -u xsrc/external/mit/ctwm/dist/add_window.c:1.1 xsrc/external/mit/ctwm/dist/add_window.c:1.2
--- xsrc/external/mit/ctwm/dist/add_window.c:1.1	Thu Sep  3 22:16:33 2015
+++ xsrc/external/mit/ctwm/dist/add_window.c	Sat Feb 27 16:20:15 2021
@@ -862,7 +862,7 @@ TwmWindow *AddWindow(Window w, int iconm
 			   tmp_win->name, namelen,
 			   _rect, _rect);
 	width = SIZE_HINDENT + ink_rect.width;
-	height = logical_rect.height + SIZE_VINDENT * 2;
+	height = Scr->SizeFont.height + SIZE_VINDENT * 2;
 	XmbTextExtents(Scr->SizeFont.font_set,
 			   ": ", 2,  _rect, _rect);
 	Scr->SizeStringOffset = width + logical_rect.width;



CVS commit: xsrc/external/mit/ctwm/dist

2021-02-27 Thread Michael van Elst
Module Name:xsrc
Committed By:   mlelstv
Date:   Sat Feb 27 16:20:15 UTC 2021

Modified Files:
xsrc/external/mit/ctwm/dist: add_window.c

Log Message:
Use font height to compute height of resize popup for placing a window.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 xsrc/external/mit/ctwm/dist/add_window.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/resize

2021-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 27 16:08:08 UTC 2021

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

Log Message:
Bump warns


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/resize/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/resize

2021-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 27 16:08:08 UTC 2021

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

Log Message:
Bump warns


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/resize/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/resize/Makefile
diff -u src/usr.bin/resize/Makefile:1.2 src/usr.bin/resize/Makefile:1.3
--- src/usr.bin/resize/Makefile:1.2	Sat Feb 27 10:36:39 2021
+++ src/usr.bin/resize/Makefile	Sat Feb 27 11:08:08 2021
@@ -1,12 +1,12 @@
-#	$NetBSD: Makefile,v 1.2 2021/02/27 15:36:39 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2021/02/27 16:08:08 christos Exp $
 
 .include 
 
-WARNS=	3
+WARNS=	5
 PROG=	resize
 SRCS=	resize.c
 
-CPPFLAGS+=-DRESIZE_ONLY
+CPPFLAGS+=-DRESIZE_ONLY -Wno-format-nonliteral
 DPADD+=	${LIBUTIL}
 LDADD+= -lutil
 



CVS commit: xsrc/external/mit/xterm/dist

2021-02-27 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Sat Feb 27 15:37:38 UTC 2021

Modified Files:
xsrc/external/mit/xterm/dist: resize.c

Log Message:
Provide an escape ifdef to avoid all the X headers


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 xsrc/external/mit/xterm/dist/resize.c

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

Modified files:

Index: xsrc/external/mit/xterm/dist/resize.c
diff -u xsrc/external/mit/xterm/dist/resize.c:1.1.1.9 xsrc/external/mit/xterm/dist/resize.c:1.2
--- xsrc/external/mit/xterm/dist/resize.c:1.1.1.9	Thu Feb 11 07:19:55 2021
+++ xsrc/external/mit/xterm/dist/resize.c	Sat Feb 27 10:37:38 2021
@@ -57,11 +57,15 @@
 #include 
 #include 
 
+#ifdef RESIZE_ONLY
+#include "resize.h"
+#else
 #include 
 #include 
 #include 
 #include 
 #include 
+#endif
 
 #ifndef USE_TERMINFO		/* avoid conflict with configure script */
 #if defined(__QNX__) || defined(__SCO__) || defined(linux) || defined(__OpenBSD__) || defined(__UNIXWARE__)



CVS commit: xsrc/external/mit/xterm/dist

2021-02-27 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Sat Feb 27 15:37:38 UTC 2021

Modified Files:
xsrc/external/mit/xterm/dist: resize.c

Log Message:
Provide an escape ifdef to avoid all the X headers


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 xsrc/external/mit/xterm/dist/resize.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/resize

2021-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 27 15:36:40 UTC 2021

Modified Files:
src/usr.bin/resize: Makefile resize.c
Added Files:
src/usr.bin/resize: resize.h resize.man
Removed Files:
src/usr.bin/resize: resize.1

Log Message:
Add a maintainable version of resize, with a copy target and a header that
provides all the glue needed without other X headers.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/resize/Makefile \
src/usr.bin/resize/resize.c
cvs rdiff -u -r1.2 -r0 src/usr.bin/resize/resize.1
cvs rdiff -u -r0 -r1.1 src/usr.bin/resize/resize.h \
src/usr.bin/resize/resize.man

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



CVS commit: src/usr.bin/resize

2021-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb 27 15:36:40 UTC 2021

Modified Files:
src/usr.bin/resize: Makefile resize.c
Added Files:
src/usr.bin/resize: resize.h resize.man
Removed Files:
src/usr.bin/resize: resize.1

Log Message:
Add a maintainable version of resize, with a copy target and a header that
provides all the glue needed without other X headers.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/resize/Makefile \
src/usr.bin/resize/resize.c
cvs rdiff -u -r1.2 -r0 src/usr.bin/resize/resize.1
cvs rdiff -u -r0 -r1.1 src/usr.bin/resize/resize.h \
src/usr.bin/resize/resize.man

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/resize/Makefile
diff -u src/usr.bin/resize/Makefile:1.1 src/usr.bin/resize/Makefile:1.2
--- src/usr.bin/resize/Makefile:1.1	Sun Dec 27 16:13:18 2020
+++ src/usr.bin/resize/Makefile	Sat Feb 27 10:36:39 2021
@@ -1,7 +1,33 @@
-#	$NetBSD: Makefile,v 1.1 2020/12/27 21:13:18 reinoud Exp $
+#	$NetBSD: Makefile,v 1.2 2021/02/27 15:36:39 christos Exp $
+
+.include 
 
 WARNS=	3
 PROG=	resize
-SRCS=	resize.c xstrings.c
+SRCS=	resize.c
+
+CPPFLAGS+=-DRESIZE_ONLY
+DPADD+=	${LIBUTIL}
+LDADD+= -lutil
 
 .include 
+
+XTERM=${X11SRCDIR}/external/mit/xterm/dist
+
+.for i in resize.c resize.man
+copy:: ${.CURDIR}/${i}
+${.CURDIR}/${i}: ${XTERM}/${i}
+	cp -p ${.ALLSRC} ${.TARGET}
+.endfor
+
+CLEANFILES+=resize.1
+
+resize.1: resize.man
+	@rm -f ${.TARGET}
+	${TOOL_SED} \
+	-e "s@__app_date__@1970-01-01@" \
+	-e "s@__app_version__@NetBSD@" \
+	-e "s@__default_termname__@vt100@" \
+	-e "s@__mansuffix__@1@" \
+	-e "s@__miscmansuffix__@7@" \
+	< ${.ALLSRC} > ${.TARGET}
Index: src/usr.bin/resize/resize.c
diff -u src/usr.bin/resize/resize.c:1.1 src/usr.bin/resize/resize.c:1.2
--- src/usr.bin/resize/resize.c:1.1	Sun Dec 27 16:13:18 2020
+++ src/usr.bin/resize/resize.c	Sat Feb 27 10:36:39 2021
@@ -1,8 +1,7 @@
-/* $NetBSD: resize.c,v 1.1 2020/12/27 21:13:18 reinoud Exp $ */
-/* $XTermId: resize.c,v 1.139 2017/05/31 08:58:56 tom Exp $ */
+/* $XTermId: resize.c,v 1.144 2020/06/03 00:26:23 tom Exp $ */
 
 /*
- * Copyright 2003-2015,2017 by Thomas E. Dickey
+ * Copyright 2003-2018,2020 by Thomas E. Dickey
  *
  * All Rights Reserved
  *
@@ -53,32 +52,51 @@
  * SOFTWARE.
  */
 
-/*
- * Extracted version from Xterm tailored for NetBSD
- */
 /* resize.c */
 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "xstrings.h"
 
+#ifdef RESIZE_ONLY
+#include "resize.h"
+#else
+#include 
+#include 
+#include 
+#include 
+#include 
+#endif
+
+#ifndef USE_TERMINFO		/* avoid conflict with configure script */
+#if defined(__QNX__) || defined(__SCO__) || defined(linux) || defined(__OpenBSD__) || defined(__UNIXWARE__)
+#define USE_TERMINFO
+#endif
+#endif
+
+#if defined(__QNX__)
+#include 
+#endif
 
-/* imported from origional  */
-#define DFT_TERMTYPE "xterm"
-#define UIntClr(dst,bits) dst = dst & (unsigned) ~(bits)
+/*
+ * Some OS's may want to use both, like SCO for example.  We catch here anyone
+ * who hasn't decided what they want.
+ */
+#if !defined(USE_TERMCAP) && !defined(USE_TERMINFO)
+#define USE_TERMINFO
+#endif
 
 #include 
 #include 
 
+#ifdef USE_IGNORE_RC
+int ignore_unused;
+#endif
+
+#ifdef __MVS__
+#define ESCAPE(string) "\047" string
+#else
 #define ESCAPE(string) "\033" string
+#endif
 
 #define	EMULATIONS	2
 #define	SUN		1
@@ -89,6 +107,7 @@
 #define	SHELL_UNKNOWN	0
 #define	SHELL_C		1
 #define	SHELL_BOURNE	2
+
 /* *INDENT-OFF* */
 static struct {
 const char *name;
@@ -124,6 +143,13 @@ static const char *const getsize[EMULATI
 ESCAPE("7") ESCAPE("[r") ESCAPE("[;H") ESCAPE("[6n"),
 ESCAPE("[18t"),
 };
+#if defined(USE_STRUCT_WINSIZE)
+static const char *const getwsize[EMULATIONS] =
+{/* size in pixels */
+0,
+ESCAPE("[14t"),
+};
+#endif /* USE_STRUCT_WINSIZE */
 static const char *const restore[EMULATIONS] =
 {
 ESCAPE("8"),
@@ -135,7 +161,13 @@ static const char *const setsize[EMULATI
 ESCAPE("[8;%s;%st"),
 };
 
+#ifdef USE_ANY_SYSV_TERMIO
+static struct termio tioorig;
+#elif defined(USE_TERMIOS)
 static struct termios tioorig;
+#else
+static struct sgttyb sgorig;
+#endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */
 
 static const char *const size[EMULATIONS] =
 {
@@ -146,6 +178,18 @@ static const char sunname[] = "sunsize";
 static int tty;
 static FILE *ttyfp;
 
+#if defined(USE_STRUCT_WINSIZE)
+static const char *wsize[EMULATIONS] =
+{
+0,
+ESCAPE("[4;%hd;%hdt"),
+};
+#endif /* USE_STRUCT_WINSIZE */
+
+static void failed(const char *) GCC_NORETURN;
+static void onintr(int) GCC_NORETURN;
+static void resize_timeout(int) GCC_NORETURN;
+static void Usage(void) GCC_NORETURN;
 
 static void
 failed(const char *s)
@@ -162,7 +206,13 @@ failed(const char *s)
 static void
 

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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 27 15:29:15 UTC 2021

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

Log Message:
tests/lint: remove stray warning 278 from test for warning 241


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_241.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_241.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_241.c
diff -u src/tests/usr.bin/xlint/lint1/msg_241.c:1.3 src/tests/usr.bin/xlint/lint1/msg_241.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_241.c:1.3	Sat Feb 27 14:54:55 2021
+++ src/tests/usr.bin/xlint/lint1/msg_241.c	Sat Feb 27 15:29:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_241.c,v 1.3 2021/02/27 14:54:55 rillig Exp $	*/
+/*	$NetBSD: msg_241.c,v 1.4 2021/02/27 15:29:15 rillig Exp $	*/
 # 3 "msg_241.c"
 
 // Test for message: dubious operation on enum, op %s [241]
@@ -18,56 +18,58 @@ enum color {
 	BLUE	= 1 << 2
 };
 
-extern void sink(int);
+extern void sink_bool(_Bool);
+extern void sink_int(int);
+extern void sink_color(enum color);
 
 void
 example(void)
 {
 	enum color c = RED;
 
-	sink(!c);			/* expect: 241 */
-	sink(~c);			/* expect: 241, 278 */
-	++c;/* expect: 241 */
-	--c;/* expect: 241 */
-	c++;/* expect: 241 */
-	c--;/* expect: 241 */
-	sink(+c);			/* expect: 241, 278 */
-	sink(-c);			/* expect: 241, 278 */
-	sink(c * c);			/* expect: 241, 278 */
-	sink(c / c);			/* expect: 241, 278 */
-	sink(c % c);			/* expect: 241, 278 */
-	sink(c + c);			/* expect: 241, 278 */
-	sink(c - c);			/* expect: 241, 278 */
-	sink(c << c);			/* expect: 241, 278 */
-	sink(c >> c);			/* expect: 241, 278 */
-
-	sink(c < c);
-	sink(c <= c);
-	sink(c > c);
-	sink(c >= c);
-	sink(c == c);
-	sink(c != c);
-
-	sink(c & c);			/* expect: 241, 278 */
-	sink(c ^ c);			/* expect: 241, 278 */
-	sink(c | c);			/* expect: 241, 278 */
-
-	sink(c && c);			/* expect: 241 */
-	sink(c || c);			/* expect: 241 */
-	sink(c ? c : BLUE);		/* expect: 278 */
+	sink_bool(!c);		/* expect: 241 */
+	sink_color(~c);		/* expect: 241 */
+	++c;			/* expect: 241 */
+	--c;			/* expect: 241 */
+	c++;			/* expect: 241 */
+	c--;			/* expect: 241 */
+	sink_color(+c);		/* expect: 241 */
+	sink_color(-c);		/* expect: 241 */
+	sink_color(c * c);	/* expect: 241 */
+	sink_color(c / c);	/* expect: 241 */
+	sink_color(c % c);	/* expect: 241 */
+	sink_color(c + c);	/* expect: 241 */
+	sink_color(c - c);	/* expect: 241 */
+	sink_color(c << c);	/* expect: 241 */
+	sink_color(c >> c);	/* expect: 241 */
+
+	sink_bool(c < c);
+	sink_bool(c <= c);
+	sink_bool(c > c);
+	sink_bool(c >= c);
+	sink_bool(c == c);
+	sink_bool(c != c);
+
+	sink_color(c & c);	/* expect: 241 */
+	sink_color(c ^ c);	/* expect: 241 */
+	sink_color(c | c);	/* expect: 241 */
+
+	sink_bool(c && c);	/* expect: 241 */
+	sink_bool(c || c);	/* expect: 241 */
+	sink_color(c ? c : BLUE);
 
 	c = GREEN;
-	c *= c;/* expect: 241 */
-	c /= c;/* expect: 241 */
-	c %= c;/* expect: 241 */
-	c += c;/* expect: 241 */
-	c -= c;/* expect: 241 */
-	c <<= c;			/* expect: 241 */
-	c >>= c;			/* expect: 241 */
-	c &= c;/* expect: 241 */
-	c ^= c;/* expect: 241 */
-	c |= c;/* expect: 241 */
+	c *= c;			/* expect: 241 */
+	c /= c;			/* expect: 241 */
+	c %= c;			/* expect: 241 */
+	c += c;			/* expect: 241 */
+	c -= c;			/* expect: 241 */
+	c <<= c;		/* expect: 241 */
+	c >>= c;		/* expect: 241 */
+	c &= c;			/* expect: 241 */
+	c ^= c;			/* expect: 241 */
+	c |= c;			/* expect: 241 */
 
 	/* The cast to unsigned is required by GCC at WARNS=6. */
-	c &= ~(unsigned)GREEN;		/* expect: 241 */
+	c &= ~(unsigned)GREEN;	/* expect: 241 */
 }

Index: src/tests/usr.bin/xlint/lint1/msg_241.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_241.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_241.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_241.exp:1.2	Sat Feb 27 14:54:55 2021
+++ src/tests/usr.bin/xlint/lint1/msg_241.exp	Sat Feb 27 15:29:15 2021
@@ -1,45 +1,31 @@
-msg_241.c(28): warning: dubious operation on enum, op ! [241]
-msg_241.c(29): warning: dubious operation on enum, op ~ [241]
-msg_241.c(29): warning: combination of 'int' and 'enum color', arg #1 [278]
-msg_241.c(30): warning: dubious operation on enum, op ++x [241]
-msg_241.c(31): warning: dubious operation on enum, op --x [241]
-msg_241.c(32): warning: dubious operation on enum, op x++ [241]
-msg_241.c(33): warning: dubious operation on enum, op x-- [241]
-msg_241.c(34): warning: dubious operation on enum, op + [241]
-msg_241.c(34): warning: combination of 'int' and 'enum color', arg #1 [278]
-msg_241.c(35): warning: dubious operation on enum, op - [241]
-msg_241.c(35): warning: combination of 'int' and 'enum color', arg #1 [278]
-msg_241.c(36): warning: dubious operation on enum, op * [241]
-msg_241.c(36): warning: combination of 'int' and 'enum color', arg #1 

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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 27 15:29:15 UTC 2021

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

Log Message:
tests/lint: remove stray warning 278 from test for warning 241


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

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-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 27 15:26:30 UTC 2021

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

Log Message:
lint: rename confusing local variable

The variable name rtp is reserved for the type of the right-hand
operand.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 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/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.218 src/usr.bin/xlint/lint1/tree.c:1.219
--- src/usr.bin/xlint/lint1/tree.c:1.218	Mon Feb 22 15:09:50 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Feb 27 15:26:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.218 2021/02/22 15:09:50 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.219 2021/02/27 15:26:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.218 2021/02/22 15:09:50 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.219 2021/02/27 15:26:30 rillig Exp $");
 #endif
 
 #include 
@@ -493,7 +493,7 @@ build(op_t op, tnode_t *ln, tnode_t *rn)
 {
 	mod_t	*mp;
 	tnode_t	*ntn;
-	type_t	*rtp;
+	type_t	*rettp;
 
 	mp = [op];
 
@@ -619,10 +619,10 @@ build(op_t op, tnode_t *ln, tnode_t *rn)
 		ntn = build_real_imag(op, ln);
 		break;
 	default:
-		rtp = mp->m_returns_bool
+		rettp = mp->m_returns_bool
 		? gettyp(Tflag ? BOOL : INT) : ln->tn_type;
 		lint_assert(mp->m_binary || rn == NULL);
-		ntn = new_tnode(op, rtp, ln, rn);
+		ntn = new_tnode(op, rettp, ln, rn);
 		break;
 	}
 



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 27 15:26:30 UTC 2021

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

Log Message:
lint: rename confusing local variable

The variable name rtp is reserved for the type of the right-hand
operand.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 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/tests/usr.bin/xlint/lint1

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 27 14:54:56 UTC 2021

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

Log Message:
tests/lint: add test for 'dubious operation on enum' [241]


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_241.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_241.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_241.c
diff -u src/tests/usr.bin/xlint/lint1/msg_241.c:1.2 src/tests/usr.bin/xlint/lint1/msg_241.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_241.c:1.2	Sun Feb 21 09:07:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_241.c	Sat Feb 27 14:54:55 2021
@@ -1,7 +1,73 @@
-/*	$NetBSD: msg_241.c,v 1.2 2021/02/21 09:07:58 rillig Exp $	*/
+/*	$NetBSD: msg_241.c,v 1.3 2021/02/27 14:54:55 rillig Exp $	*/
 # 3 "msg_241.c"
 
 // Test for message: dubious operation on enum, op %s [241]
+//
+// As of February 2021, the option -e is not enabled by default in
+// share/mk/sys.mk, therefore this message is neither well-known nor
+// well-tested.
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+/* lint1-extra-flags: -e */
+
+/*
+ * Enums are a possible implementation of bit-sets.
+ */
+enum color {
+	RED	= 1 << 0,
+	GREEN	= 1 << 1,
+	BLUE	= 1 << 2
+};
+
+extern void sink(int);
+
+void
+example(void)
+{
+	enum color c = RED;
+
+	sink(!c);			/* expect: 241 */
+	sink(~c);			/* expect: 241, 278 */
+	++c;/* expect: 241 */
+	--c;/* expect: 241 */
+	c++;/* expect: 241 */
+	c--;/* expect: 241 */
+	sink(+c);			/* expect: 241, 278 */
+	sink(-c);			/* expect: 241, 278 */
+	sink(c * c);			/* expect: 241, 278 */
+	sink(c / c);			/* expect: 241, 278 */
+	sink(c % c);			/* expect: 241, 278 */
+	sink(c + c);			/* expect: 241, 278 */
+	sink(c - c);			/* expect: 241, 278 */
+	sink(c << c);			/* expect: 241, 278 */
+	sink(c >> c);			/* expect: 241, 278 */
+
+	sink(c < c);
+	sink(c <= c);
+	sink(c > c);
+	sink(c >= c);
+	sink(c == c);
+	sink(c != c);
+
+	sink(c & c);			/* expect: 241, 278 */
+	sink(c ^ c);			/* expect: 241, 278 */
+	sink(c | c);			/* expect: 241, 278 */
+
+	sink(c && c);			/* expect: 241 */
+	sink(c || c);			/* expect: 241 */
+	sink(c ? c : BLUE);		/* expect: 278 */
+
+	c = GREEN;
+	c *= c;/* expect: 241 */
+	c /= c;/* expect: 241 */
+	c %= c;/* expect: 241 */
+	c += c;/* expect: 241 */
+	c -= c;/* expect: 241 */
+	c <<= c;			/* expect: 241 */
+	c >>= c;			/* expect: 241 */
+	c &= c;/* expect: 241 */
+	c ^= c;/* expect: 241 */
+	c |= c;/* expect: 241 */
+
+	/* The cast to unsigned is required by GCC at WARNS=6. */
+	c &= ~(unsigned)GREEN;		/* expect: 241 */
+}

Index: src/tests/usr.bin/xlint/lint1/msg_241.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_241.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_241.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_241.exp:1.1	Sat Jan  2 10:22:44 2021
+++ src/tests/usr.bin/xlint/lint1/msg_241.exp	Sat Feb 27 14:54:55 2021
@@ -1 +1,45 @@
-msg_241.c(6): syntax error ':' [249]
+msg_241.c(28): warning: dubious operation on enum, op ! [241]
+msg_241.c(29): warning: dubious operation on enum, op ~ [241]
+msg_241.c(29): warning: combination of 'int' and 'enum color', arg #1 [278]
+msg_241.c(30): warning: dubious operation on enum, op ++x [241]
+msg_241.c(31): warning: dubious operation on enum, op --x [241]
+msg_241.c(32): warning: dubious operation on enum, op x++ [241]
+msg_241.c(33): warning: dubious operation on enum, op x-- [241]
+msg_241.c(34): warning: dubious operation on enum, op + [241]
+msg_241.c(34): warning: combination of 'int' and 'enum color', arg #1 [278]
+msg_241.c(35): warning: dubious operation on enum, op - [241]
+msg_241.c(35): warning: combination of 'int' and 'enum color', arg #1 [278]
+msg_241.c(36): warning: dubious operation on enum, op * [241]
+msg_241.c(36): warning: combination of 'int' and 'enum color', arg #1 [278]
+msg_241.c(37): warning: dubious operation on enum, op / [241]
+msg_241.c(37): warning: combination of 'int' and 'enum color', arg #1 [278]
+msg_241.c(38): warning: dubious operation on enum, op % [241]
+msg_241.c(38): warning: combination of 'int' and 'enum color', arg #1 [278]
+msg_241.c(39): warning: dubious operation on enum, op + [241]
+msg_241.c(39): warning: combination of 'int' and 'enum color', arg #1 [278]
+msg_241.c(40): warning: dubious operation on enum, op - [241]
+msg_241.c(40): warning: combination of 'int' and 'enum color', arg #1 [278]
+msg_241.c(41): warning: dubious operation on enum, op << [241]
+msg_241.c(41): warning: combination of 'int' and 'enum color', arg #1 [278]
+msg_241.c(42): warning: dubious operation on enum, op >> [241]
+msg_241.c(42): warning: combination of 'int' and 'enum color', arg #1 [278]
+msg_241.c(51): warning: 

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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 27 14:54:56 UTC 2021

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

Log Message:
tests/lint: add test for 'dubious operation on enum' [241]


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

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

2021-02-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Feb 27 14:22:07 UTC 2021

Modified Files:
src/sys/arch/arm/pic: picvar.h

Log Message:
machine/cpufunc.h -> arm/cpufunc.h for the benefit of non-evbarm ports


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/pic/picvar.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/pic

2021-02-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Feb 27 14:22:07 UTC 2021

Modified Files:
src/sys/arch/arm/pic: picvar.h

Log Message:
machine/cpufunc.h -> arm/cpufunc.h for the benefit of non-evbarm ports


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/pic/picvar.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/pic/picvar.h
diff -u src/sys/arch/arm/pic/picvar.h:1.32 src/sys/arch/arm/pic/picvar.h:1.33
--- src/sys/arch/arm/pic/picvar.h:1.32	Fri Feb 26 10:06:42 2021
+++ src/sys/arch/arm/pic/picvar.h	Sat Feb 27 14:22:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: picvar.h,v 1.32 2021/02/26 10:06:42 jmcneill Exp $	*/
+/*	$NetBSD: picvar.h,v 1.33 2021/02/27 14:22:07 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -107,7 +107,7 @@ void	intr_ipi_send(const kcpuset_t *, u_
 #include 
 #include 
 
-#include 
+#include 
 
 #ifndef PIC_MAXPICS
 #define PIC_MAXPICS	32



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 27 13:43:36 UTC 2021

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

Log Message:
tests/lint: add more tests for enum mismatch


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_130.c \
src/tests/usr.bin/xlint/lint1/msg_156.c \
src/tests/usr.bin/xlint/lint1/msg_156.exp
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_130.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_130.c
diff -u src/tests/usr.bin/xlint/lint1/msg_130.c:1.3 src/tests/usr.bin/xlint/lint1/msg_130.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_130.c:1.3	Sun Jan 31 11:12:07 2021
+++ src/tests/usr.bin/xlint/lint1/msg_130.c	Sat Feb 27 13:43:36 2021
@@ -1,18 +1,39 @@
-/*	$NetBSD: msg_130.c,v 1.3 2021/01/31 11:12:07 rillig Exp $	*/
+/*	$NetBSD: msg_130.c,v 1.4 2021/02/27 13:43:36 rillig Exp $	*/
 # 3 "msg_130.c"
 
 // Test for message: enum type mismatch, op %s [130]
 
 enum color {
-	RED, GREEN, BLUE
+	RED	= 1 << 0,
+	GREEN	= 1 << 1,
+	BLUE	= 1 << 2
+};
+
+enum size {
+	SMALL,
+	MEDIUM,
+	LARGE
 };
 
 enum daytime {
 	NIGHT, MORNING, NOON, EVENING
 };
 
-int
-example(_Bool cond)
+void sink(_Bool);
+
+void
+example(_Bool cond, enum color c, enum size s)
 {
-	return cond ? GREEN : MORNING;	/* expect: 130 */
+	sink(cond ? GREEN : MORNING);	/* expect: 130 */
+
+	sink(c != s);			/* expect: 130 */
+	sink(c == s);			/* expect: 130 */
+	sink((c & MEDIUM) != 0);	/* might be useful to warn about */
+	sink((c | MEDIUM) != 0);	/* might be useful to warn about */
+
+	c |= MEDIUM;			/* might be useful to warn about */
+	c &= MEDIUM;			/* might be useful to warn about */
+
+	/* The cast to unsigned is required by GCC at WARNS=6. */
+	c &= ~(unsigned)MEDIUM;		/* might be useful to warn about */
 }
Index: src/tests/usr.bin/xlint/lint1/msg_156.c
diff -u src/tests/usr.bin/xlint/lint1/msg_156.c:1.3 src/tests/usr.bin/xlint/lint1/msg_156.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_156.c:1.3	Sun Jan 31 11:12:07 2021
+++ src/tests/usr.bin/xlint/lint1/msg_156.c	Sat Feb 27 13:43:36 2021
@@ -1,12 +1,12 @@
-/*	$NetBSD: msg_156.c,v 1.3 2021/01/31 11:12:07 rillig Exp $	*/
+/*	$NetBSD: msg_156.c,v 1.4 2021/02/27 13:43:36 rillig Exp $	*/
 # 3 "msg_156.c"
 
 // Test for message: enum type mismatch, arg #%d [156]
 
 enum color {
-	RED,
-	GREEN,
-	BLUE
+	RED	= 1 << 0,
+	GREEN	= 1 << 1,
+	BLUE	= 1 << 2
 };
 
 enum size {
@@ -15,11 +15,14 @@ enum size {
 	LARGE
 };
 
-void
-print_color(enum color);
+void print_color(enum color);
 
 void
-example(void)
+example(enum color c, enum size s)
 {
+	print_color(GREEN);
+	print_color(c);
+
 	print_color(MEDIUM);		/* expect: 156 */
+	print_color(s);			/* expect: 156 */
 }
Index: src/tests/usr.bin/xlint/lint1/msg_156.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_156.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_156.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_156.exp:1.3	Thu Jan 14 07:42:31 2021
+++ src/tests/usr.bin/xlint/lint1/msg_156.exp	Sat Feb 27 13:43:36 2021
@@ -1 +1,2 @@
-msg_156.c(24): warning: enum type mismatch, arg #1 (enum color != enum size) [156]
+msg_156.c(26): warning: enum type mismatch, arg #1 (enum color != enum size) [156]
+msg_156.c(27): warning: enum type mismatch, arg #1 (enum color != enum size) [156]

Index: src/tests/usr.bin/xlint/lint1/msg_130.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_130.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_130.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_130.exp:1.2	Fri Jan  8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_130.exp	Sat Feb 27 13:43:36 2021
@@ -1 +1,3 @@
-msg_130.c(17): warning: enum type mismatch, op : [130]
+msg_130.c(27): warning: enum type mismatch, op : [130]
+msg_130.c(29): warning: enum type mismatch, op != [130]
+msg_130.c(30): warning: enum type mismatch, op == [130]



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

2021-02-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb 27 13:43:36 UTC 2021

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

Log Message:
tests/lint: add more tests for enum mismatch


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

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



CVS commit: src/sys/kern

2021-02-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Feb 27 13:02:42 UTC 2021

Modified Files:
src/sys/kern: kern_ktrace.c

Log Message:
Use "static" in the function intro if the function is static.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/sys/kern/kern_ktrace.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/kern/kern_ktrace.c
diff -u src/sys/kern/kern_ktrace.c:1.177 src/sys/kern/kern_ktrace.c:1.178
--- src/sys/kern/kern_ktrace.c:1.177	Sat May 23 23:42:43 2020
+++ src/sys/kern/kern_ktrace.c	Sat Feb 27 13:02:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_ktrace.c,v 1.177 2020/05/23 23:42:43 ad Exp $	*/
+/*	$NetBSD: kern_ktrace.c,v 1.178 2021/02/27 13:02:42 simonb Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.177 2020/05/23 23:42:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.178 2021/02/27 13:02:42 simonb Exp $");
 
 #include 
 #include 
@@ -262,7 +262,7 @@ ktrinit(void)
 /*
  * Release a reference.  Called with ktrace_lock held.
  */
-void
+static void
 ktdrel(struct ktr_desc *ktd)
 {
 
@@ -278,7 +278,7 @@ ktdrel(struct ktr_desc *ktd)
 	}
 }
 
-void
+static void
 ktdref(struct ktr_desc *ktd)
 {
 
@@ -288,7 +288,7 @@ ktdref(struct ktr_desc *ktd)
 	ktrace_on++;
 }
 
-struct ktr_desc *
+static struct ktr_desc *
 ktd_lookup(file_t *fp)
 {
 	struct ktr_desc *ktd;
@@ -411,7 +411,7 @@ freekte:
 	ktrexit(l);
 }
 
-void
+static void
 ktefree(struct ktrace_entry *kte)
 {
 
@@ -426,7 +426,7 @@ ktefree(struct ktrace_entry *kte)
  * same underlying vnode/socket.
  */
 
-int
+static int
 ktrsamefile(file_t *f1, file_t *f2)
 {
 
@@ -462,7 +462,7 @@ ktradref(struct proc *p)
 	ktdref(ktd);
 }
 
-int
+static int
 ktrderefall(struct ktr_desc *ktd, int auth)
 {
 	lwp_t *curl = curlwp;
@@ -1165,7 +1165,7 @@ sys_fktrace(struct lwp *l, const struct 
 	return error;
 }
 
-int
+static int
 ktrops(lwp_t *curl, struct proc *p, int ops, int facs,
 struct ktr_desc *ktd)
 {
@@ -1231,7 +1231,7 @@ ktrops(lwp_t *curl, struct proc *p, int 
 	return error ? 0 : 1;
 }
 
-int
+static int
 ktrsetchildren(lwp_t *curl, struct proc *top, int ops, int facs,
 struct ktr_desc *ktd)
 {
@@ -1265,7 +1265,7 @@ ktrsetchildren(lwp_t *curl, struct proc 
 	/*NOTREACHED*/
 }
 
-void
+static void
 ktrwrite(struct ktr_desc *ktd, struct ktrace_entry *kte)
 {
 	size_t hlen;
@@ -1359,7 +1359,7 @@ again:
 	}
 }
 
-void
+static void
 ktrace_thread(void *arg)
 {
 	struct ktr_desc *ktd = arg;
@@ -1427,7 +1427,7 @@ ktrace_thread(void *arg)
  *
  * TODO: check groups.  use caller effective gid.
  */
-int
+static int
 ktrcanset(lwp_t *calll, struct proc *targetp)
 {
 	KASSERT(mutex_owned(targetp->p_lock));



CVS commit: src/sys/kern

2021-02-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Feb 27 13:02:42 UTC 2021

Modified Files:
src/sys/kern: kern_ktrace.c

Log Message:
Use "static" in the function intro if the function is static.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/sys/kern/kern_ktrace.c

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



CVS commit: src/libexec/httpd

2021-02-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Feb 27 12:55:25 UTC 2021

Modified Files:
src/libexec/httpd: CHANGES bozohttpd.c content-bozo.c

Log Message:
changes in bozohttpd 20210227:
o  new support for content types: .tar.bz2, .tar.xz, .tar.lz,
   .tar.zst, .tbz2, .txz, .tlz, .zipx, .xz, .zst, .sz, .lz, .lzma,
   .lzo, .7z, .lzo, .cab, .dmg, .jar, and .rar.  should fix
   netbsd PR#56026:
   MIME type of .tar.xz file on ny{cdn,ftp}.NetBSD.org is invalid


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/libexec/httpd/CHANGES
cvs rdiff -u -r1.127 -r1.128 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.19 -r1.20 src/libexec/httpd/content-bozo.c

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



CVS commit: src/libexec/httpd

2021-02-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Feb 27 12:55:25 UTC 2021

Modified Files:
src/libexec/httpd: CHANGES bozohttpd.c content-bozo.c

Log Message:
changes in bozohttpd 20210227:
o  new support for content types: .tar.bz2, .tar.xz, .tar.lz,
   .tar.zst, .tbz2, .txz, .tlz, .zipx, .xz, .zst, .sz, .lz, .lzma,
   .lzo, .7z, .lzo, .cab, .dmg, .jar, and .rar.  should fix
   netbsd PR#56026:
   MIME type of .tar.xz file on ny{cdn,ftp}.NetBSD.org is invalid


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/libexec/httpd/CHANGES
cvs rdiff -u -r1.127 -r1.128 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.19 -r1.20 src/libexec/httpd/content-bozo.c

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

Modified files:

Index: src/libexec/httpd/CHANGES
diff -u src/libexec/httpd/CHANGES:1.46 src/libexec/httpd/CHANGES:1.47
--- src/libexec/httpd/CHANGES:1.46	Sat Feb 27 12:36:46 2021
+++ src/libexec/httpd/CHANGES	Sat Feb 27 12:55:25 2021
@@ -1,4 +1,11 @@
-$NetBSD: CHANGES,v 1.46 2021/02/27 12:36:46 mrg Exp $
+$NetBSD: CHANGES,v 1.47 2021/02/27 12:55:25 mrg Exp $
+
+changes in bozohttpd 20210227:
+	o  new support for content types: .tar.bz2, .tar.xz, .tar.lz,
+	   .tar.zst, .tbz2, .txz, .tlz, .zipx, .xz, .zst, .sz, .lz, .lzma,
+	   .lzo, .7z, .lzo, .cab, .dmg, .jar, and .rar.  should fix
+	   netbsd PR#56026:
+	   MIME type of .tar.xz file on ny{cdn,ftp}.NetBSD.org is invalid
 
 changes in bozohttpd 20210211:
 	o  fix various NULL derefs from malformed headers.  mostly from

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.127 src/libexec/httpd/bozohttpd.c:1.128
--- src/libexec/httpd/bozohttpd.c:1.127	Sat Feb 27 12:36:46 2021
+++ src/libexec/httpd/bozohttpd.c	Sat Feb 27 12:55:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.127 2021/02/27 12:36:46 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.128 2021/02/27 12:55:25 mrg Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -108,7 +108,7 @@
 #define INDEX_HTML		"index.html"
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE		"bozohttpd/20210211"
+#define SERVER_SOFTWARE		"bozohttpd/20210227"
 #endif
 #ifndef PUBLIC_HTML
 #define PUBLIC_HTML		"public_html"

Index: src/libexec/httpd/content-bozo.c
diff -u src/libexec/httpd/content-bozo.c:1.19 src/libexec/httpd/content-bozo.c:1.20
--- src/libexec/httpd/content-bozo.c:1.19	Thu Oct 15 04:21:53 2020
+++ src/libexec/httpd/content-bozo.c	Sat Feb 27 12:55:25 2021
@@ -1,9 +1,9 @@
-/*	$NetBSD: content-bozo.c,v 1.19 2020/10/15 04:21:53 mrg Exp $	*/
+/*	$NetBSD: content-bozo.c,v 1.20 2021/02/27 12:55:25 mrg Exp $	*/
 
 /*	$eterna: content-bozo.c,v 1.17 2011/11/18 09:21:15 mrg Exp $	*/
 
 /*
- * Copyright (c) 1997-2020 Matthew R. Green
+ * Copyright (c) 1997-2021 Matthew R. Green
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -63,11 +63,18 @@ static bozo_content_map_t static_content
 	{ ".pa",	"application/x-ns-proxy-autoconfig", "",	"", NULL },
 	{ ".tar",	"multipart/x-tar",		"",		"", NULL },
 	{ ".gtar",	"application/x-gtar-compressed", "",		"", NULL },
-	{ ".tar.Z",	"application/x-gtar-compressed", "",		"", NULL },
 	{ ".tar.gz",	"application/x-gtar-compressed", "",		"", NULL },
-	{ ".taz",	"application/x-gtar-compressed", "",		"", NULL },
+	{ ".tar.bz2",	"application/x-gtar-compressed", "",		"", NULL },
+	{ ".tar.xz",	"application/x-gtar-compressed", "",		"", NULL },
+	{ ".tar.lz",	"application/x-gtar-compressed", "",		"", NULL },
+	{ ".tar.zst",	"application/x-gtar-compressed", "",		"", NULL },
 	{ ".tgz",	"application/x-gtar-compressed", "",		"", NULL },
+	{ ".tbz2",	"application/x-gtar-compressed", "",		"", NULL },
+	{ ".txz",	"application/x-gtar-compressed", "",		"", NULL },
+	{ ".tlz",	"application/x-gtar-compressed", "",		"", NULL },
 	{ ".tar.z",	"application/x-gtar-compressed", "",		"", NULL },
+	{ ".tar.Z",	"application/x-gtar-compressed", "",		"", NULL },
+	{ ".taz",	"application/x-gtar-compressed", "",		"", NULL },
 	{ ".Z",		"application/x-compress",	"",		"", NULL },
 	{ ".gz",	"application/x-g

  1   2   >