#include "babel_zebra.h"
#include "babel_errors.h"
-static void babel_fail(void);
+static FRR_NORETURN void babel_fail(void);
static void babel_init_random(void);
-static void babel_exit_properly(void);
+static FRR_NORETURN void babel_exit_properly(void);
static void babel_save_state_file(void);
.cap_num_i = 0
};
-static void
-babel_sigexit(void)
+static FRR_NORETURN void babel_sigexit(void)
{
zlog_notice("Terminating on signal");
return 0;
}
-static void
-babel_fail(void)
+static FRR_NORETURN void babel_fail(void)
{
exit(1);
}
return ;
}
-static void
-babel_exit_properly(void)
+static FRR_NORETURN void babel_exit_properly(void)
{
debugf(BABEL_DEBUG_COMMON, "Exiting...");
usleep(roughly(10000));
zlog_rotate();
}
-static void sigterm_handler(void)
+static FRR_NORETURN void sigterm_handler(void)
{
bglobal.bg_shutdown = true;
AC_C_FLAG([-Wundef])
AC_C_FLAG([-Wimplicit-fallthrough])
AC_C_FLAG([-Wshadow])
+AC_C_FLAG([-Wmissing-noreturn])
+AC_C_FLAG([-Wno-error=missing-noreturn])
if test "$enable_gcc_ultra_verbose" = "yes" ; then
AC_C_FLAG([-Wcast-qual])
- AC_C_FLAG([-Wmissing-noreturn])
AC_C_FLAG([-Wmissing-format-attribute])
AC_C_FLAG([-Wunreachable-code])
AC_C_FLAG([-Wpacked])
}
/* SIGINT / SIGTERM handler. */
-static void sigint(void)
+static FRR_NORETURN void sigint(void)
{
zlog_notice("Terminating on signal");
zclient_sync_init();
}
-static void
-lde_shutdown(void)
+static FRR_NORETURN void lde_shutdown(void)
{
/* close pipes */
if (iev_ldpe) {
return (0);
}
-static void
-ldpd_shutdown(void)
+static FRR_NORETURN void ldpd_shutdown(void)
{
pid_t pid;
int status;
#include "libfrr.h"
#include "zlog_live.h"
-static void ldpe_shutdown(void);
+static FRR_NORETURN void ldpe_shutdown(void);
static void ldpe_dispatch_main(struct event *thread);
static void ldpe_dispatch_lde(struct event *thread);
#ifdef __OpenBSD__
};
/* SIGINT / SIGTERM handler. */
-static void
-sigint(void)
+static FRR_NORETURN void sigint(void)
{
ldpe_shutdown();
}
accept_init();
}
-static void
-ldpe_shutdown(void)
+static FRR_NORETURN void ldpe_shutdown(void)
{
struct if_addr *if_addr;
struct adj *adj;
/* ignore harmless bugs in old versions of flex */
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+#pragma GCC diagnostic ignored "-Wmissing-noreturn"
#include "lib/command_parse.h"
#define _DATA_SECTION(name) __attribute__((section(".data." name)))
#endif
+/* Wrapper for the 'noreturn' metadata */
+#define FRR_NORETURN __attribute__((noreturn))
+
#ifdef __cplusplus
}
#endif
/* ignore harmless bugs in old versions of flex */
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-value"
+#pragma GCC diagnostic ignored "-Wmissing-noreturn"
#include "config.h"
#include <Python.h>
/* poll() is interrupted by the signal; handled below */
}
-static void frr_daemon_wait(int fd)
+static FRR_NORETURN void frr_daemon_wait(int fd)
{
struct pollfd pfd[1];
int ret;
extern int qmem_walk(qmem_walk_fn *func, void *arg);
extern int log_memstats(const char *daemon_name, bool enabled);
-extern __attribute__((__noreturn__)) void memory_oom(size_t size,
- const char *name);
+extern FRR_NORETURN void memory_oom(size_t size, const char *name);
#ifdef __cplusplus
}
return NULL;
}
-static void __attribute__((noreturn))
-exit_handler(int signo, siginfo_t *siginfo, void *context)
+static void FRR_NORETURN exit_handler(int signo, siginfo_t *siginfo,
+ void *context)
{
void *pc = program_counter(context);
_exit(128 + signo);
}
-static void __attribute__((noreturn))
-core_handler(int signo, siginfo_t *siginfo, void *context)
+static void FRR_NORETURN core_handler(int signo, siginfo_t *siginfo,
+ void *context)
{
void *pc = program_counter(context);
}
}
-static void mgmt_fe_abort_if_session(void *data)
+static FRR_NORETURN void mgmt_fe_abort_if_session(void *data)
{
struct mgmt_fe_session_ctx *session = data;
zlog_rotate();
}
-static void nhrp_request_stop(void)
+static FRR_NORETURN void nhrp_request_stop(void)
{
debugf(NHRP_DEBUG_COMMON, "Exiting...");
frr_early_fini();
}
/* SIGINT handler. */
-static void sigint(void)
+static FRR_NORETURN void sigint(void)
{
zlog_notice("Terminating on signal SIGINT");
ospf6_exit(0);
}
/* SIGTERM handler. */
-static void sigterm(void)
+static FRR_NORETURN void sigterm(void)
{
zlog_notice("Terminating on signal SIGTERM");
ospf6_exit(0);
}
/* SIGINT / SIGTERM handler. */
-static void sigint(void)
+static FRR_NORETURN void sigint(void)
{
zlog_notice("Terminating on signal");
bfd_protocol_integration_set_shutdown(true);
}
/* SIGINT / SIGTERM handler. */
-static void sigint(void)
+static FRR_NORETURN void sigint(void)
{
zlog_notice("Terminating on signal");
zlog_notice("Unregister from opaque,etc ");
}
/* SIGINT / SIGTERM handler. */
-static void sigint(void)
+static FRR_NORETURN void sigint(void)
{
zlog_notice("Terminating on signal");
zlog_info("SIGHUP received, ignoring");
}
-static void pim6_sigint(void)
+static FRR_NORETURN void pim6_sigint(void)
{
zlog_notice("Terminating on signal SIGINT");
pim6_terminate();
exit(1);
}
-static void pim6_sigterm(void)
+static FRR_NORETURN void pim6_sigterm(void)
{
zlog_notice("Terminating on signal SIGTERM");
pim6_terminate();
zlog_info("SIGHUP received, ignoring");
}
-static void pim_sigint(void)
+static FRR_NORETURN void pim_sigint(void)
{
zlog_notice("Terminating on signal SIGINT");
pim_terminate();
exit(1);
}
-static void pim_sigterm(void)
+static FRR_NORETURN void pim_sigterm(void)
{
zlog_notice("Terminating on signal SIGTERM");
pim_terminate();
}
/* SIGINT handler. */
-static void sigint(void)
+static FRR_NORETURN void sigint(void)
{
struct vrf *vrf;
}
/* SIGINT handler. */
-static void sigint(void)
+static FRR_NORETURN void sigint(void)
{
struct vrf *vrf;
}
/* SIGINT / SIGTERM handler. */
-static void sigint(void)
+static FRR_NORETURN void sigint(void)
{
zlog_notice("Terminating on signal");
}
/* SIGINT / SIGTERM handler. */
-static void sigint(void)
+static FRR_NORETURN void sigint(void)
{
zlog_notice("Terminating on signal");
}
/* Help information display. */
-static void usage(int status)
+static FRR_NORETURN void usage(int status)
{
if (status != 0)
fprintf(stderr, "Try `%s --help' for more information.\n",
}
}
-static void sigint(void)
+static FRR_NORETURN void sigint(void)
{
zlog_notice("Terminating on signal");
systemd_send_stopping();
#else /* !GNU_LINUX */
-static void netns_setup(const char *nsname)
+static FRR_NORETURN void netns_setup(const char *nsname)
{
fprintf(stderr, "network namespaces are only available on Linux\n");
exit(1);