diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-03-17 13:46:18 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-03-18 00:38:20 +0000 |
commit | f77866689c7dd13632f7e61f7acb0534289e793b (patch) | |
tree | 54131252cb8f3e804a378ae4f6ac3108fb1fc9a5 | |
parent | e50f81f211deee19efedb2fef6e319a5b51b503c (diff) | |
download | ucspi-vsock-f77866689c7dd13632f7e61f7acb0534289e793b.tar ucspi-vsock-f77866689c7dd13632f7e61f7acb0534289e793b.tar.gz ucspi-vsock-f77866689c7dd13632f7e61f7acb0534289e793b.tar.bz2 ucspi-vsock-f77866689c7dd13632f7e61f7acb0534289e793b.tar.lz ucspi-vsock-f77866689c7dd13632f7e61f7acb0534289e793b.tar.xz ucspi-vsock-f77866689c7dd13632f7e61f7acb0534289e793b.tar.zst ucspi-vsock-f77866689c7dd13632f7e61f7acb0534289e793b.zip |
Use C11 noreturn instead of GNU attribute extension
Message-Id: <20210318001240.3897-1-hi@alyssa.is> Reviewed-by: Cole Helbling <cole.e.helbling@outlook.com>
-rw-r--r-- | log.h | 4 | ||||
-rw-r--r-- | vsockclient.c | 8 | ||||
-rw-r--r-- | vsockserver.c | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/log.h b/log.h index a1b0c16..ea9e9cf 100644 --- a/log.h +++ b/log.h @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later -// SPDX-FileCopyrightText: 2020 Alyssa Ross <hi@alyssa.is> +// SPDX-FileCopyrightText: 2020-2021 Alyssa Ross <hi@alyssa.is> #include <stdarg.h> @@ -13,7 +13,7 @@ extern enum verbosity verbosity; // Log an error message, followed by strerrno(errno), then exit with // status eval. -void diee(int eval, const char *fmt, ...) __attribute__((noreturn)); +_Noreturn void diee(int eval, const char *fmt, ...); // Log an error message. void elog(const char *fmt, ...); diff --git a/vsockclient.c b/vsockclient.c index ff8b7dc..91e1320 100644 --- a/vsockclient.c +++ b/vsockclient.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later -// SPDX-FileCopyrightText: 2020 Alyssa Ross <hi@alyssa.is> +// SPDX-FileCopyrightText: 2020-2021 Alyssa Ross <hi@alyssa.is> #define _GNU_SOURCE @@ -7,9 +7,10 @@ #include <inttypes.h> #include <stdio.h> #include <stdlib.h> +#include <stdnoreturn.h> +#include <sys/socket.h> #include <sysexits.h> #include <unistd.h> -#include <sys/socket.h> #include <linux/vm_sockets.h> @@ -18,8 +19,7 @@ #include "util.h" #include "vsock.h" -static void ex_usage(void) __attribute__((noreturn)); -static void ex_usage(void) +noreturn static void ex_usage(void) { if (verbosity) fprintf(stderr, "Usage: %s [ -q | -Q | -v ] cid port prog...\n", diff --git a/vsockserver.c b/vsockserver.c index 2fb4f8e..0317cd4 100644 --- a/vsockserver.c +++ b/vsockserver.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later -// SPDX-FileCopyrightText: 2020 Alyssa Ross <hi@alyssa.is> +// SPDX-FileCopyrightText: 2020-2021 Alyssa Ross <hi@alyssa.is> #define _GNU_SOURCE @@ -9,6 +9,7 @@ #include <stdbool.h> #include <stdio.h> #include <stdlib.h> +#include <stdnoreturn.h> #include <string.h> #include <sys/socket.h> #include <sys/wait.h> @@ -22,8 +23,7 @@ #include "util.h" #include "vsock.h" -static void ex_usage(void) __attribute__((noreturn)); -static void ex_usage(void) +noreturn static void ex_usage(void) { if (verbosity) fprintf(stderr, "Usage: %s [ -1 ] [ -q | -Q | -v ] cid port prog...\n", |