From: Christian Göttsche Date: Mon, 6 Apr 2020 14:27:39 +0000 (+0200) Subject: [Minor] Enable missing_noreturn compiler warning X-Git-Tag: 2.6~531^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6da3282ea865b8c39fab3e7026296fa922e1a64;p=thirdparty%2Frspamd.git [Minor] Enable missing_noreturn compiler warning --- diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index 4dd011d988..2dcad92ef4 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -10,6 +10,7 @@ CHECK_C_COMPILER_FLAG(-Wno-sign-compare SUPPORT_WSIGN_COMPARE) CHECK_C_COMPILER_FLAG(-Wstrict-prototypes SUPPORT_WSTRICT_PROTOTYPES) CHECK_C_COMPILER_FLAG(-pedantic SUPPORT_PEDANTIC_FLAG) CHECK_C_COMPILER_FLAG(-Wno-unused-const-variable SUPPORT_WNO_UNUSED_CONST) +CHECK_C_COMPILER_FLAG(-Wmissing-noreturn SUPPORT_WMISSING_NORETURN) # GCC 6 specific CHECK_C_COMPILER_FLAG(-Wnull-dereference SUPPORT_WNULL_DEREFERENCE) CHECK_C_COMPILER_FLAG(-Wduplicated-cond SUPPORT_WDUPLICATED_COND) @@ -67,6 +68,9 @@ ENDIF() IF(SUPPORT_WIMPLICIT_FALLTHROUGH) ADD_COMPILE_OPTIONS("-Wno-implicit-fallthrough") ENDIF(SUPPORT_WIMPLICIT_FALLTHROUGH) +IF(SUPPORT_WMISSING_NORETURN) + ADD_COMPILE_OPTIONS("-Wmissing-noreturn") +ENDIF(SUPPORT_WMISSING_NORETURN) CHECK_C_COMPILER_FLAG(-fPIC SUPPORT_FPIC) IF(SUPPORT_FPIC) diff --git a/contrib/snowball/compiler/driver.c b/contrib/snowball/compiler/driver.c index 9cbe447a58..587028fa48 100644 --- a/contrib/snowball/compiler/driver.c +++ b/contrib/snowball/compiler/driver.c @@ -25,6 +25,7 @@ static int eq(const char * s1, const char * s2) { return strcmp(s1, s2) == 0; } +__attribute__((noreturn)) static void print_arglist(int exit_code) { FILE * f = exit_code ? stderr : stdout; fprintf(f, "Usage: snowball SOURCE_FILE... [OPTIONS]\n\n" diff --git a/src/controller.c b/src/controller.c index cfea10971c..4ed3f187cd 100644 --- a/src/controller.c +++ b/src/controller.c @@ -3477,6 +3477,7 @@ rspamd_controller_register_plugins_paths (struct rspamd_controller_worker_ctx *c /* * Start worker process */ +__attribute__((noreturn)) void start_controller_worker (struct rspamd_worker *worker) { diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index b6d7d8ee7c..5eb403ce79 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -2120,6 +2120,7 @@ fuzzy_peer_rep (struct rspamd_worker *worker, /* * Start worker process */ +__attribute__((noreturn)) void start_fuzzy (struct rspamd_worker *worker) { diff --git a/src/libcryptobox/cryptobox.c b/src/libcryptobox/cryptobox.c index 414dbdfa11..4ef366b330 100644 --- a/src/libcryptobox/cryptobox.c +++ b/src/libcryptobox/cryptobox.c @@ -93,6 +93,7 @@ rspamd_cryptobox_cpuid (gint cpu[4], gint info) static sig_atomic_t ok = 0; static jmp_buf j; +__attribute__((noreturn)) static void rspamd_cryptobox_ill_handler (int signo) { diff --git a/src/rspamadm/configdump.c b/src/rspamadm/configdump.c index 90f7514876..bbdb58c178 100644 --- a/src/rspamadm/configdump.c +++ b/src/rspamadm/configdump.c @@ -230,6 +230,7 @@ rspamadm_dump_section_obj (struct rspamd_config *cfg, } } +__attribute__((noreturn)) static void rspamadm_configdump (gint argc, gchar **argv, const struct rspamadm_command *cmd) { diff --git a/src/rspamadm/confighelp.c b/src/rspamadm/confighelp.c index f5695ed537..c40891216b 100644 --- a/src/rspamadm/confighelp.c +++ b/src/rspamadm/confighelp.c @@ -190,6 +190,7 @@ rspamadm_confighelp_search_word (const ucl_object_t *obj, const gchar *str) return res; } +__attribute__((noreturn)) static void rspamadm_confighelp (gint argc, gchar **argv, const struct rspamadm_command *cmd) { diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c index ffcbf58245..83ae3785c7 100644 --- a/src/rspamd_proxy.c +++ b/src/rspamd_proxy.c @@ -2282,6 +2282,7 @@ adjust_upstreams_limits (struct rspamd_proxy_ctx *ctx) } } +__attribute__((noreturn)) void start_rspamd_proxy (struct rspamd_worker *worker) { diff --git a/src/worker.c b/src/worker.c index ad7f126746..1a3b118c80 100644 --- a/src/worker.c +++ b/src/worker.c @@ -477,6 +477,7 @@ init_worker (struct rspamd_config *cfg) /* * Start worker process */ +__attribute__((noreturn)) void start_worker (struct rspamd_worker *worker) {