From: Baptiste Daroussin Date: Tue, 17 Sep 2024 08:41:00 +0000 (+0200) Subject: analysis: mark a couple of function as noreturn X-Git-Tag: RELEASE_1_5_0~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9304da2042c7320382ab4c91555c97028c703b3;p=thirdparty%2Fmlmmj.git analysis: mark a couple of function as noreturn This helps code analysis tools. --- diff --git a/include/mlmmj.h b/include/mlmmj.h index 3c6f2d21..e0181a3d 100644 --- a/include/mlmmj.h +++ b/include/mlmmj.h @@ -37,6 +37,10 @@ #define NELEM(array) (sizeof(array) / sizeof((array)[0])) #endif +#ifndef __dead2 +#define __dead2 __attribute__((__noreturn__)) +#endif + #define RELAYHOST "127.0.0.1" #define READ_BUFSIZE 2048 #define DEFAULT_RECIPDELIM "+" /* Default recipient delimiter */ diff --git a/include/send_help.h b/include/send_help.h index 352f70e3..69d814c5 100644 --- a/include/send_help.h +++ b/include/send_help.h @@ -23,5 +23,5 @@ #pragma once -void send_help(struct ml *ml, const char *queuefilename, const char *emailaddr); +void send_help(struct ml *ml, const char *queuefilename, const char *emailaddr) __dead2; void send_help_noexit(struct ml *ml, const char *queuefilename, const char *emailaddr); diff --git a/include/send_list.h b/include/send_list.h index 6051ea5f..b6f4abe4 100644 --- a/include/send_list.h +++ b/include/send_list.h @@ -25,7 +25,7 @@ #include "mlmmj.h" -void send_list(struct ml *ml, const char *emailaddr); +void send_list(struct ml *ml, const char *emailaddr) __dead2; struct subs_list_state; struct subs_list_state *init_subs_list(int fd, const char *dirname); void rewind_subs_list(void *state); diff --git a/src/listcontrol.c b/src/listcontrol.c index 2a02604a..bbdc7618 100644 --- a/src/listcontrol.c +++ b/src/listcontrol.c @@ -110,7 +110,7 @@ is_valid_email(const char *email, const char *log) return (true); } -static void +__dead2 static void lc_sub(struct listcontrol *lc, struct ml *ml, struct sub *sub) { if (!is_valid_email(lc->fromemail, sub->typereq))