diff options
author | flu0r1ne <flu0r1ne@flu0r1ne.net> | 2023-09-09 22:56:05 -0500 |
---|---|---|
committer | flu0r1ne <flu0r1ne@flu0r1ne.net> | 2023-09-09 22:56:05 -0500 |
commit | 93ce8e8489bda4a7ebe5161020c83a68f744481f (patch) | |
tree | 7574d867d44877ef496fe3a0c2e49e7b966fb171 | |
parent | 99c942c90063c73734e56bacaa65f947772d9186 (diff) | |
download | fcgiwrap-93ce8e8489bda4a7ebe5161020c83a68f744481f.tar.xz fcgiwrap-93ce8e8489bda4a7ebe5161020c83a68f744481f.zip |
Fix implicit fallthrough false positive, noreturn
With warnings and pedantic mode enabled, `gcc (GCC) 13.2.1` returns
an implicit fall through warning. This can be fixed by annotating
the error function with NORETURN.
-rw-r--r-- | fcgiwrap.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -56,6 +56,12 @@ #define UNIX_PATH_MAX 108 #endif +#if defined(__GNUC__) || defined(__clang__) +# define NORETURN __attribute__((__noreturn__)) +#else +# define NORETURN +#endif + extern char **environ; static char * const * inherited_environ; static const char **allowed_programs; @@ -500,7 +506,7 @@ static bool is_allowed_program(const char *program) { return false; } -static void cgi_error(const char *message, const char *reason, const char *filename) +static void NORETURN cgi_error(const char *message, const char *reason, const char *filename) { printf("Status: %s\r\nContent-Type: text/plain\r\n\r\n%s\r\n", message, message); |