From 992bd3b18b4f740a0150bff6d08e090bda0fab82 Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Mon, 9 Nov 2009 05:56:48 -0500 Subject: [PATCH] Teach it to compiler and analyzer that function `lafe_errc' is no return. Found by Clang Static Analyzer. SVN-Revision: 1626 --- libarchive_fe/err.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libarchive_fe/err.h b/libarchive_fe/err.h index 164e2d384..dd7944813 100644 --- a/libarchive_fe/err.h +++ b/libarchive_fe/err.h @@ -26,9 +26,16 @@ #ifndef LAFE_ERR_H #define LAFE_ERR_H +#if defined(__GNUC__) && (__GNUC__ > 2 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) +#define __LA_DEAD __attribute__((__noreturn__)) +#else +#define __LA_DEAD +#endif + extern const char *lafe_progname; void lafe_warnc(int code, const char *fmt, ...); -void lafe_errc(int eval, int code, const char *fmt, ...); +void lafe_errc(int eval, int code, const char *fmt, ...) __LA_DEAD; #endif -- 2.47.3