diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2021-11-26 04:42:14 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2021-11-26 04:42:14 +0000 |
commit | 40b812c05c0157a523edab8835fbb03675293e3f (patch) | |
tree | dc0fd2dea826e57a136b7294985054637b75b21a | |
parent | fa2ed5ace4aecb1ab212c842ce986f275264d3f0 (diff) |
Mark exit1() and sigexit() as non-returning
The late 1990s reasons for avoiding __dead with exit1() should not apply
with the current compilers.
This fixes compiler warnings about uninitialized variables in trap.c
on mips64.
Discussed with guenther@ and miod@
-rw-r--r-- | sys/kern/kern_kthread.c | 9 | ||||
-rw-r--r-- | sys/sys/proc.h | 4 | ||||
-rw-r--r-- | sys/sys/signalvar.h | 4 |
3 files changed, 6 insertions, 11 deletions
diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index 0360c2245d9..11cf5c02705 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_kthread.c,v 1.45 2021/11/24 12:40:40 visa Exp $ */ +/* $OpenBSD: kern_kthread.c,v 1.46 2021/11/26 04:42:13 visa Exp $ */ /* $NetBSD: kern_kthread.c,v 1.3 1998/12/22 21:21:36 kleink Exp $ */ /*- @@ -94,12 +94,7 @@ kthread_exit(int ecode) curproc->p_p->ps_comm, curproc->p_tid, ecode); exit1(curproc, ecode, 0, EXIT_NORMAL); - - /* - * XXX Fool the compiler. Making exit1() __dead is a can - * XXX of worms right now. - */ - for (;;); + /* NOTREACHED */ } struct kthread_q { diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 52192e26902..c418ba9414e 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.315 2021/10/23 14:53:02 claudio Exp $ */ +/* $OpenBSD: proc.h,v 1.316 2021/11/26 04:42:13 visa Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /*- @@ -571,7 +571,7 @@ void endtsleep(void *); int wakeup_proc(struct proc *, const volatile void *); void unsleep(struct proc *); void reaper(void *); -void exit1(struct proc *, int, int, int); +__dead void exit1(struct proc *, int, int, int); void exit2(struct proc *); int dowait4(struct proc *, pid_t, int *, int, struct rusage *, register_t *); diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h index 3f42de53b5b..4990cf6d0e9 100644 --- a/sys/sys/signalvar.h +++ b/sys/sys/signalvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: signalvar.h,v 1.51 2021/11/24 10:28:55 claudio Exp $ */ +/* $OpenBSD: signalvar.h,v 1.52 2021/11/26 04:42:13 visa Exp $ */ /* $NetBSD: signalvar.h,v 1.17 1996/04/22 01:23:31 christos Exp $ */ /* @@ -103,7 +103,7 @@ void ptsignal(struct proc *p, int sig, enum signal_type type); void siginit(struct sigacts *); void trapsignal(struct proc *p, int sig, u_long code, int type, union sigval val); -void sigexit(struct proc *, int); +__dead void sigexit(struct proc *, int); void sigabort(struct proc *); int sigismasked(struct proc *, int); int sigonstack(size_t); |