]> git.armaanb.net Git - opendoas.git/commitdiff
libopenbsd: define __dead as noreturn
authorDuncan Overbruck <mail@duncano.de>
Fri, 6 Dec 2019 01:43:57 +0000 (02:43 +0100)
committerDuncan Overbruck <mail@duncano.de>
Mon, 3 Feb 2020 21:41:30 +0000 (22:41 +0100)
includes.h
libopenbsd/errc.c
libopenbsd/openbsd.h
libopenbsd/verrc.c

index d4967e05985c0a9a3b04ecc73794dd78fd9e37fb..401a0e4f22d28fba3dd969bb38b69bb3ab8554cc 100644 (file)
@@ -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
index 37eff0fd1f49e78f4e999055f558e30c579490f9..b82d4198f7f6da4e4dae5bd592dcc896b8104795 100644 (file)
@@ -33,7 +33,7 @@
 #include <err.h>
 #include <stdarg.h>
 
-__dead void
+void __dead
 errc(int eval, int code, const char *fmt, ...)
 {
        va_list ap;
index 793d9bf39363668845867b3cd35e827993e8eea4..da420de7fdd63832973f891cc053ab2cd706b178 100644 (file)
@@ -4,6 +4,14 @@
 #include <stdarg.h>
 #include <sys/types.h>
 
+#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
index 15400bc1069d8b0ff7c03ed1f401b67b51be1599..c155a9208a46eec3e3d51e0d3e3b42ef3eba7312 100644 (file)
@@ -36,7 +36,7 @@
 #include <string.h>
 #include <stdarg.h>
 
-__dead void
+void __dead
 verrc(int eval, int code, const char *fmt, va_list ap)
 {
        (void)fprintf(stderr, "%s: ", getprogname());