From 395eb7955a4ceed9078c8bbb590fa0f982d8a15c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 16 Sep 2018 18:40:15 +0200 Subject: [PATCH] Add noreturn to functions that don't return Fix the extra semicolon and unreachable code --- src/ccache.c | 4 +++- src/ccache.h | 2 +- src/util.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ccache.c b/src/ccache.c index 592158bca..e5c606384 100644 --- a/src/ccache.c +++ b/src/ccache.c @@ -40,6 +40,9 @@ extern char *current_working_dir; extern char *stats_file; extern unsigned lock_staleness_limit; +static void failed(void) ATTR_NORETURN; +static void ccache(int argc, char *argv[]) ATTR_NORETURN; + int ccache_main(int argc, char *argv[]); static const char VERSION_TEXT[] = @@ -3624,5 +3627,4 @@ ccache_main(int argc, char *argv[]) free(program_name); ccache(argc, argv); - return 1; } diff --git a/src/ccache.h b/src/ccache.h index 973d42dd3..4779619e5 100644 --- a/src/ccache.h +++ b/src/ccache.h @@ -8,7 +8,7 @@ #ifdef __GNUC__ #define ATTR_FORMAT(x, y, z) __attribute__((format (x, y, z))) -#define ATTR_NORETURN __attribute__((noreturn)); +#define ATTR_NORETURN __attribute__((noreturn)) #else #define ATTR_FORMAT(x, y, z) #define ATTR_NORETURN diff --git a/src/util.c b/src/util.c index 7efbea4b6..52d162513 100644 --- a/src/util.c +++ b/src/util.c @@ -99,6 +99,8 @@ path_max(const char *path) #endif } +static void warn_log_fail(void) ATTR_NORETURN; + // Warn about failure writing to the log file and then exit. static void warn_log_fail(void) -- 2.47.2