Mercurial > hg > toybox
changeset 166:5f1d3ad8a888
Add noreturn mark to [p]error_exit(), suggested by Charlie Shepherd.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 15 Nov 2007 21:12:24 -0600 |
parents | ad48dca1f4c5 |
children | f16c8e5e9435 |
files | lib/lib.h lib/portability.h |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/lib.h Thu Nov 15 20:52:01 2007 -0600 +++ b/lib/lib.h Thu Nov 15 21:12:24 2007 -0600 @@ -43,8 +43,8 @@ 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);
--- a/lib/portability.h Thu Nov 15 20:52:01 2007 -0600 +++ b/lib/portability.h Thu Nov 15 21:12:24 2007 -0600 @@ -3,6 +3,11 @@ #include <stdio.h> #define fdprintf(...) dprintf(__VA_ARGS__) +#ifdef __GNUC__ +#define noreturn __attribute__((noreturn)) +#else +#define noreturn +#endif #ifndef __APPLE__ #include <byteswap.h>