lots of misc cleanups for compiler warnings

ratbox_lib.c:159:1: warning: function 'rb_lib_restart' could be declared
                    with attribute 'noreturn' [-Wmissing-noreturn]

ratbox_lib.c:220:1: warning: function 'rb_lib_loop' could be declared
                    with attribute 'noreturn' [-Wmissing-noreturn]

restart.c:55:1: warning: function 'server_reboot' could be declared with
                attribute 'noreturn' [-Wmissing-noreturn]
This commit is contained in:
Aaron Jones 2017-07-31 05:48:14 +00:00
parent 6f1e0a6f47
commit 82e920102f
No known key found for this signature in database
GPG key ID: 8AF0737488AB3012
6 changed files with 9 additions and 11 deletions

View file

@ -27,7 +27,7 @@
#ifndef INCLUDED_restart_h
#define INCLUDED_restart_h
void restart(const char *);
void server_reboot(void);
void restart(const char *) __attribute__((noreturn));
void server_reboot(void) __attribute__((noreturn));
#endif

View file

@ -179,14 +179,14 @@ typedef void die_cb(const char *buffer);
char *rb_ctime(const time_t, char *, size_t);
char *rb_date(const time_t, char *, size_t);
void rb_lib_log(const char *, ...);
void rb_lib_restart(const char *, ...);
void rb_lib_restart(const char *, ...) __attribute__((noreturn));
void rb_lib_die(const char *, ...);
void rb_set_time(void);
const char *rb_lib_version(void);
void rb_lib_init(log_cb * xilog, restart_cb * irestart, die_cb * idie, int closeall, int maxfds,
size_t dh_size, size_t fd_heap_size);
void rb_lib_loop(long delay);
void rb_lib_loop(long delay) __attribute__((noreturn));
time_t rb_current_time(void);
const struct timeval *rb_current_time_tv(void);

View file

@ -34,7 +34,7 @@
#include <stdlib.h>
void rb_outofmemory(void);
void rb_outofmemory(void) __attribute__((noreturn));
static inline void *
rb_malloc(size_t size)

View file

@ -95,6 +95,5 @@ mo_restart(struct Client *client_p, struct Client *source_p, int parc, const cha
rb_sprintf(buf, "Server RESTART by %s", get_client_name(source_p, HIDE_IP));
restart(buf);
return 0;
/* UNREACHABLE */
}

View file

@ -418,7 +418,7 @@ ircd_log_cb(const char *str)
ilog(L_MAIN, "libratbox reports: %s", str);
}
static void
static void __attribute__((noreturn))
ircd_restart_cb(const char *str)
{
inotice("libratbox has called the restart callback: %s", str);
@ -730,6 +730,5 @@ main(int argc, char *argv[])
ConfigFileEntry.dpath, getpid());
rb_lib_loop(0);
return 0;
/* UNREACHABLE */
}

View file

@ -1257,7 +1257,7 @@ main(int argc, char **argv)
if(!ssld_ssl_ok)
send_nossl_support(mod_ctl, NULL);
rb_lib_loop(0);
return 0;
/* UNREACHABLE */
}