diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/controller.c | 1 | ||||
-rw-r--r-- | src/fuzzy_storage.c | 1 | ||||
-rw-r--r-- | src/libcryptobox/cryptobox.c | 1 | ||||
-rw-r--r-- | src/libserver/logger/logger_private.h | 6 | ||||
-rw-r--r-- | src/libserver/re_cache.c | 2 | ||||
-rw-r--r-- | src/libserver/rspamd_control.c | 4 | ||||
-rw-r--r-- | src/libserver/url.c | 5 | ||||
-rw-r--r-- | src/libstat/backends/redis_backend.c | 9 | ||||
-rw-r--r-- | src/libutil/multipattern.c | 6 | ||||
-rw-r--r-- | src/libutil/sqlite_utils.c | 2 | ||||
-rw-r--r-- | src/lua/lua_cryptobox.c | 4 | ||||
-rw-r--r-- | src/lua/lua_task.c | 4 | ||||
-rw-r--r-- | src/lua/lua_worker.c | 4 | ||||
-rw-r--r-- | src/rspamadm/configdump.c | 1 | ||||
-rw-r--r-- | src/rspamadm/confighelp.c | 1 | ||||
-rw-r--r-- | src/rspamd_proxy.c | 1 | ||||
-rw-r--r-- | src/worker.c | 1 |
17 files changed, 34 insertions, 19 deletions
diff --git a/src/controller.c b/src/controller.c index cfea10971..4ed3f187c 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 b6d7d8ee7..5eb403ce7 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 414dbdfa1..4ef366b33 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/libserver/logger/logger_private.h b/src/libserver/logger/logger_private.h index 5fc258914..79831f2ee 100644 --- a/src/libserver/logger/logger_private.h +++ b/src/libserver/logger/logger_private.h @@ -103,7 +103,7 @@ bool rspamd_log_file_log (const gchar *module, const gchar *id, bool rspamd_log_file_on_fork (rspamd_logger_t *logger, struct rspamd_config *cfg, gpointer arg, GError **err); -const static struct rspamd_logger_funcs file_log_funcs = { +static const struct rspamd_logger_funcs file_log_funcs = { .init = rspamd_log_file_init, .dtor = rspamd_log_file_dtor, .reload = rspamd_log_file_reload, @@ -127,7 +127,7 @@ bool rspamd_log_syslog_log (const gchar *module, const gchar *id, rspamd_logger_t *rspamd_log, gpointer arg); -const static struct rspamd_logger_funcs syslog_log_funcs = { +static const struct rspamd_logger_funcs syslog_log_funcs = { .init = rspamd_log_syslog_init, .dtor = rspamd_log_syslog_dtor, .reload = rspamd_log_syslog_reload, @@ -151,7 +151,7 @@ bool rspamd_log_console_log (const gchar *module, const gchar *id, rspamd_logger_t *rspamd_log, gpointer arg); -const static struct rspamd_logger_funcs console_log_funcs = { +static const struct rspamd_logger_funcs console_log_funcs = { .init = rspamd_log_console_init, .dtor = rspamd_log_console_dtor, .reload = rspamd_log_console_reload, diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c index 6dc13220b..fe5e1476b 100644 --- a/src/libserver/re_cache.c +++ b/src/libserver/re_cache.c @@ -391,7 +391,7 @@ rspamd_re_cache_init (struct rspamd_re_cache *cache, struct rspamd_config *cfg) rspamd_regexp_set_cache_id (re, i); if (re_class->st == NULL) { - posix_memalign ((void **)&re_class->st, _Alignof (rspamd_cryptobox_hash_state_t), + (void) !posix_memalign ((void **)&re_class->st, _Alignof (rspamd_cryptobox_hash_state_t), sizeof (*re_class->st)); g_assert (re_class->st != NULL); rspamd_cryptobox_hash_init (re_class->st, NULL, 0); diff --git a/src/libserver/rspamd_control.c b/src/libserver/rspamd_control.c index 0dc04d291..2670263f3 100644 --- a/src/libserver/rspamd_control.c +++ b/src/libserver/rspamd_control.c @@ -781,7 +781,7 @@ rspamd_control_ignore_io_handler (int fd, short what, void *ud) struct rspamd_control_reply rep; /* At this point we just ignore replies from the workers */ - (void)read (fd, &rep, sizeof (rep)); + (void) !read (fd, &rep, sizeof (rep)); rspamd_control_stop_pending (elt); } @@ -793,7 +793,7 @@ rspamd_control_log_pipe_io_handler (int fd, short what, void *ud) struct rspamd_control_reply rep; /* At this point we just ignore replies from the workers */ - (void) read (fd, &rep, sizeof (rep)); + (void) !read (fd, &rep, sizeof (rep)); rspamd_control_stop_pending (elt); } diff --git a/src/libserver/url.c b/src/libserver/url.c index 6aceb8fa6..db89073f5 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -3941,11 +3941,10 @@ bool rspamd_url_host_set_add (khash_t (rspamd_url_host_hash) *set, struct rspamd_url *u) { - khiter_t k; gint r; if (set) { - k = kh_put (rspamd_url_host_hash, set, u, &r); + kh_put (rspamd_url_host_hash, set, u, &r); if (r == 0) { return false; @@ -3991,4 +3990,4 @@ rspamd_url_host_set_has (khash_t (rspamd_url_host_hash) *set, struct rspamd_url } return false; -}
\ No newline at end of file +} diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 107af3490..392f1704e 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -372,6 +372,12 @@ rspamd_redis_maybe_auth (struct redis_stat_ctx *ctx, redisAsyncContext *redis) } } +// the `b` conversion type character is unknown to gcc +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif static rspamd_fstring_t * rspamd_redis_tokens_to_query (struct rspamd_task *task, struct redis_stat_runtime *rt, @@ -625,6 +631,9 @@ rspamd_redis_tokens_to_query (struct rspamd_task *task, return out; } +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif static void rspamd_redis_store_stat_signature (struct rspamd_task *task, diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c index 547762d26..8ddd9af38 100644 --- a/src/libutil/multipattern.c +++ b/src/libutil/multipattern.c @@ -256,7 +256,7 @@ rspamd_multipattern_create (enum rspamd_multipattern_flags flags) struct rspamd_multipattern *mp; /* Align due to blake2b state */ - posix_memalign((void **)&mp, _Alignof (struct rspamd_multipattern), + (void) !posix_memalign((void **)&mp, _Alignof (struct rspamd_multipattern), sizeof (*mp)); g_assert (mp != NULL); memset (mp, 0, sizeof (*mp)); @@ -285,7 +285,7 @@ rspamd_multipattern_create_sized (guint npatterns, struct rspamd_multipattern *mp; /* Align due to blake2b state */ - posix_memalign((void **)&mp, _Alignof (struct rspamd_multipattern), sizeof (*mp)); + (void) !posix_memalign((void **)&mp, _Alignof (struct rspamd_multipattern), sizeof (*mp)); g_assert (mp != NULL); memset (mp, 0, sizeof (*mp)); mp->flags = flags; @@ -789,4 +789,4 @@ gboolean rspamd_multipattern_has_hyperscan (void) { return rspamd_hs_check (); -}
\ No newline at end of file +} diff --git a/src/libutil/sqlite_utils.c b/src/libutil/sqlite_utils.c index 9bb0b9c1f..f9e47032c 100644 --- a/src/libutil/sqlite_utils.c +++ b/src/libutil/sqlite_utils.c @@ -356,7 +356,7 @@ rspamd_sqlite3_open_or_create (rspamd_mempool_t *pool, const gchar *path, const else { pid_t myself = getpid (); msg_debug_pool_check ("locking %s to block other processes", lock_path); - (void)write (lock_fd, &myself, sizeof (myself)); + (void) !write (lock_fd, &myself, sizeof (myself)); g_assert (rspamd_file_lock (lock_fd, FALSE)); has_lock = TRUE; diff --git a/src/lua/lua_cryptobox.c b/src/lua/lua_cryptobox.c index 07b4888b9..784abea65 100644 --- a/src/lua/lua_cryptobox.c +++ b/src/lua/lua_cryptobox.c @@ -1008,7 +1008,7 @@ rspamd_lua_hash_create (const gchar *type) } else if (g_ascii_strcasecmp (type, "blake2") == 0) { h->type = LUA_CRYPTOBOX_HASH_BLAKE2; - posix_memalign ((void **)&h->content.h, _Alignof (rspamd_cryptobox_hash_state_t), + (void) !posix_memalign ((void **)&h->content.h, _Alignof (rspamd_cryptobox_hash_state_t), sizeof (*h->content.h)); g_assert (h->content.h != NULL); rspamd_cryptobox_hash_init (h->content.h, NULL, 0); @@ -1045,7 +1045,7 @@ rspamd_lua_hash_create (const gchar *type) } else { h->type = LUA_CRYPTOBOX_HASH_BLAKE2; - posix_memalign ((void **)&h->content.h, _Alignof (rspamd_cryptobox_hash_state_t), + (void) !posix_memalign ((void **)&h->content.h, _Alignof (rspamd_cryptobox_hash_state_t), sizeof (*h->content.h)); g_assert (h->content.h != NULL); rspamd_cryptobox_hash_init (h->content.h, NULL, 0); diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 2d6257443..6f1eeaf3f 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -2423,13 +2423,13 @@ lua_task_has_urls (lua_State * L) { LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); - gboolean need_emails = FALSE, ret = FALSE; + gboolean ret = FALSE; gsize sz = 0; if (task) { if (task->message) { if (lua_gettop (L) >= 2) { - need_emails = lua_toboolean (L, 2); + lua_toboolean (L, 2); } if (kh_size (MESSAGE_FIELD (task, urls)) > 0) { diff --git a/src/lua/lua_worker.c b/src/lua/lua_worker.c index a286069cb..badc50a72 100644 --- a/src/lua/lua_worker.c +++ b/src/lua/lua_worker.c @@ -746,7 +746,7 @@ rspamd_lua_subprocess_io (EV_P_ ev_io *w, int revents) /* Write reply to the child */ rspamd_socket_blocking (cbdata->sp[0]); memset (rep, 0, sizeof (rep)); - (void)write (cbdata->sp[0], rep, sizeof (rep)); + (void) !write (cbdata->sp[0], rep, sizeof (rep)); } } } @@ -891,4 +891,4 @@ void luaopen_worker (lua_State * L) { rspamd_lua_new_class (L, "rspamd{worker}", worker_reg); -}
\ No newline at end of file +} diff --git a/src/rspamadm/configdump.c b/src/rspamadm/configdump.c index 90f751487..bbdb58c17 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 f5695ed53..c40891216 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 ffcbf5824..83ae3785c 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 ad7f12674..1a3b118c8 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) { |