From 5dc1cdecb149196c944c3a0983051eeae6c2b3a0 Mon Sep 17 00:00:00 2001 From: Duncan Overbruck Date: Fri, 6 Dec 2019 02:43:57 +0100 Subject: [PATCH] libopenbsd: define __dead as noreturn --- includes.h | 8 -------- libopenbsd/errc.c | 2 +- libopenbsd/openbsd.h | 12 ++++++++++-- libopenbsd/verrc.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/includes.h b/includes.h index d4967e0..401a0e4 100644 --- a/includes.h +++ b/includes.h @@ -1,14 +1,6 @@ #ifndef INCLUDES_H #define INCLUDES_H -#ifndef __UNUSED -# define __UNUSED __attribute__ ((unused)) -#endif - -#ifndef __dead -# define __dead -#endif - #ifndef _PATH_TTY # define _PATH_TTY "/dev/tty" #endif diff --git a/libopenbsd/errc.c b/libopenbsd/errc.c index 37eff0f..b82d419 100644 --- a/libopenbsd/errc.c +++ b/libopenbsd/errc.c @@ -33,7 +33,7 @@ #include #include -__dead void +void __dead errc(int eval, int code, const char *fmt, ...) { va_list ap; diff --git a/libopenbsd/openbsd.h b/libopenbsd/openbsd.h index 793d9bf..da420de 100644 --- a/libopenbsd/openbsd.h +++ b/libopenbsd/openbsd.h @@ -4,6 +4,14 @@ #include #include +#ifndef __UNUSED +# define __UNUSED __attribute__ ((unused)) +#endif + +#ifndef __dead +# define __dead __attribute__ ((noreturn)) +#endif + /* API definitions lifted from OpenBSD src/include */ /* pwd.h */ @@ -45,10 +53,10 @@ void closefrom(int); /* err.h */ #ifndef HAVE_VERRC -void verrc(int eval, int code, const char *fmt, va_list ap); +void __dead verrc(int eval, int code, const char *fmt, va_list ap); #endif /* !HAVE_VERRC */ #ifndef HAVE_ERRC -void errc(int eval, int code, const char *fmt, ...); +__dead void errc(int eval, int code, const char *fmt, ...); #endif /* !HAVE_ERRC */ #ifndef HAVE_SETPROGNAME diff --git a/libopenbsd/verrc.c b/libopenbsd/verrc.c index 15400bc..c155a92 100644 --- a/libopenbsd/verrc.c +++ b/libopenbsd/verrc.c @@ -36,7 +36,7 @@ #include #include -__dead void +void __dead verrc(int eval, int code, const char *fmt, va_list ap) { (void)fprintf(stderr, "%s: ", getprogname()); -- 2.39.2