Specify that exit functions are noreturn.

Fixes a warning on clang.
This commit is contained in:
Érico Nogueira 2021-09-20 20:29:57 -03:00
parent 3e4b5a3eb9
commit 83de8de084
1 changed files with 3 additions and 2 deletions

View File

@ -15,6 +15,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdnoreturn.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
@ -26,14 +27,14 @@
#define BYTE1(x) (x & 0xff)
#define BYTE2(x) ((x>>8)&0xff)
static void e(const char *str)
static noreturn void e(const char *str)
{
fputs(str, stderr);
fputc('\n', stderr);
exit(1);
}
static void ep(const char *str, int v)
static noreturn void ep(const char *str, int v)
{
fprintf(stderr, "%s: %d\n", str, v);
exit(1);