patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Subject: [PATCH ucspi-vsock] Use C11 noreturn instead of GNU attribute extension
Date: Thu, 18 Mar 2021 00:12:40 +0000	[thread overview]
Message-ID: <20210318001240.3897-1-hi@alyssa.is> (raw)

---
 log.h         | 4 ++--
 vsockclient.c | 8 ++++----
 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",
-- 
2.30.0

             reply	other threads:[~2021-03-18  0:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18  0:12 Alyssa Ross [this message]
2021-03-18  0:15 ` Cole Helbling
2021-03-18  0:42   ` Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210318001240.3897-1-hi@alyssa.is \
    --to=hi@alyssa.is \
    --cc=devel@spectrum-os.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).