From efa93b987a355385d0b1a1ac4e3a0e25db63b494 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 15 Nov 2007 21:12:24 -0600 Subject: Add noreturn mark to [p]error_exit(), suggested by Charlie Shepherd. --- lib/lib.h | 4 ++-- lib/portability.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/lib.h b/lib/lib.h index 6fce34c8..07f4a6d8 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -43,8 +43,8 @@ void strlcpy(char *dest, char *src, size_t size); void verror_msg(char *msg, int err, va_list va); void error_msg(char *msg, ...); void perror_msg(char *msg, ...); -void error_exit(char *msg, ...); -void perror_exit(char *msg, ...); +void error_exit(char *msg, ...) noreturn; +void perror_exit(char *msg, ...) noreturn; void *xmalloc(size_t size); void *xzalloc(size_t size); void *xrealloc(void *ptr, size_t size); diff --git a/lib/portability.h b/lib/portability.h index 6ed1dc4f..34f7994f 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -3,6 +3,11 @@ #include #define fdprintf(...) dprintf(__VA_ARGS__) +#ifdef __GNUC__ +#define noreturn __attribute__((noreturn)) +#else +#define noreturn +#endif #ifndef __APPLE__ #include -- cgit v1.2.3