From ab919ab0a2b35038e04cdd8889216ffecdd9f120 Mon Sep 17 00:00:00 2001 From: kientzle Date: Sat, 6 Dec 2008 07:15:42 +0000 Subject: Make the GCC-specific __dead2 markers conditional on whether we're compiling under GCC. --- usr.bin/cpio/cpio.h | 2 +- usr.bin/cpio/cpio_platform.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'usr.bin/cpio') diff --git a/usr.bin/cpio/cpio.h b/usr.bin/cpio/cpio.h index 9af8a09..e85345d 100644 --- a/usr.bin/cpio/cpio.h +++ b/usr.bin/cpio/cpio.h @@ -89,7 +89,7 @@ struct cpio { /* Name of this program; used in error reporting, initialized in main(). */ const char *cpio_progname; -void cpio_errc(int _eval, int _code, const char *fmt, ...) __dead2; +void cpio_errc(int _eval, int _code, const char *fmt, ...) __LA_DEAD; void cpio_warnc(int _code, const char *fmt, ...); int owner_parse(const char *, int *, int *); diff --git a/usr.bin/cpio/cpio_platform.h b/usr.bin/cpio/cpio_platform.h index 3145198..c251fa4 100644 --- a/usr.bin/cpio/cpio_platform.h +++ b/usr.bin/cpio/cpio_platform.h @@ -81,4 +81,12 @@ #endif #endif +/* How to mark functions that don't return. */ +#if defined(__GNUC__) && (__GNUC__ > 2 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) +#define __LA_DEAD __attribute__((__noreturn__)) +#else +#define __LA_DEAD +#endif + #endif /* !CPIO_PLATFORM_H_INCLUDED */ -- cgit v1.1