diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2023-09-09 22:56:05 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2023-09-09 22:56:05 -0500 |
| commit | df3998e885b9cf9d0ac385f405db3905c50621c0 (patch) | |
| tree | 7574d867d44877ef496fe3a0c2e49e7b966fb171 /fcgiwrap.c | |
| parent | 97e7ed57cee0ed00ec6dd91408df6054348491a2 (diff) | |
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.
Diffstat (limited to 'fcgiwrap.c')
| -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); |
