]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
analysis: mark a couple of function as noreturn
authorBaptiste Daroussin <bapt@FreeBSD.org>
Tue, 17 Sep 2024 08:41:00 +0000 (10:41 +0200)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Tue, 17 Sep 2024 08:41:00 +0000 (10:41 +0200)
This helps code analysis tools.

include/mlmmj.h
include/send_help.h
include/send_list.h
src/listcontrol.c

index 3c6f2d21fe5b8a66c5966476695198e11019b4b6..e0181a3dafa3499c5b2a39a16ca80ba4cc480935 100644 (file)
 #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 */
index 352f70e3000523739187db0b5930c0b20d3eab25..69d814c5375403cc75d865f2b8c0eddc2a9ec92a 100644 (file)
@@ -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);
index 6051ea5fd36a3df8094e8c790ecb871c45d9d2af..b6f4abe48dc6b283d6496b112a9c6c90af5a498b 100644 (file)
@@ -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);
index 2a02604a25694f6cc958c295f63b69f9ad7d16bd..bbdc761828080f8409a21c4e19636f1fbad345cc 100644 (file)
@@ -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))