From e37500d29b2b699762e1aa196b14c41303bb1055 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 29 Nov 2008 22:45:45 +0100 Subject: [PATCH] Add -Wmissing-noreturn to compiler flags. And mark all exit functions of gui.c with __noreturn. --- Makefile.in | 1 + gui.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3831e1c4..5dd08d6d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -46,6 +46,7 @@ CPPFLAGS += -DCODENAME='"$(codename)"' CPPFLAGS += -DCC_VERSION='"$(cc_version)"' CPPFLAGS += -Werror-implicit-function-declaration CPPFLAGS += -Wmissing-format-attribute +CPPFLAGS += -Wmissing-noreturn CPPFLAGS += -Wunused-macros CPPFLAGS += -Wbad-function-cast CPPFLAGS += -DMAIN_INPUT_FILE_IS_$(*F) diff --git a/gui.c b/gui.c index 9a02bdca..58850715 100644 --- a/gui.c +++ b/gui.c @@ -523,7 +523,7 @@ static void setup_signal_handling(void) signal(SIGHUP, SIG_IGN); } -static void do_exit(int ret) +__noreturn static void do_exit(int ret) { signal(SIGTERM, SIG_IGN); kill(0, SIGTERM); @@ -539,7 +539,7 @@ static void shutdown_curses(void) endwin(); } -static void finish(int ret) +__noreturn static void finish(int ret) { shutdown_curses(); do_exit(ret); @@ -548,7 +548,7 @@ static void finish(int ret) /* * exit curses and print given message to stdout/stderr */ -__printf_2_3 static void msg_n_exit(int ret, const char* fmt, ...) +__noreturn __printf_2_3 static void msg_n_exit(int ret, const char* fmt, ...) { va_list argp; FILE *outfd = ret? stderr: stdout; @@ -1280,7 +1280,7 @@ static void com_version(void) CODENAME "\""); } -static void com_quit(void) +__noreturn static void com_quit(void) { finish(0); } -- 2.39.5