From 0177cc42ef8636815e7c9d0718c2f3129d431cfb Mon Sep 17 00:00:00 2001 From: Khyber Sen Date: Mon, 7 Oct 2024 03:14:37 -0700 Subject: [PATCH] runtime: use `__attribute__((__noreturn__))` instead of `_Noreturn` to avoid errors `_Noreturn` doesn't exist before C11, and is deprecated in C23 (in favor or `[[noreturn]]`), so it's simpler just to use `__attribute__((__noreturn__))` since we don't know what C version the headers will be compiled with. --- runtime/libia2/include/ia2_internal.h | 2 +- runtime/libia2/init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/libia2/include/ia2_internal.h b/runtime/libia2/include/ia2_internal.h index a8684afbe..57912af0e 100644 --- a/runtime/libia2/include/ia2_internal.h +++ b/runtime/libia2/include/ia2_internal.h @@ -313,7 +313,7 @@ static int ia2_mprotect_with_tag(void *addr, size_t len, int prot, int tag) { char *allocate_stack(int i); void verify_tls_padding(void); void ensure_pkeys_allocated(int *n_to_alloc); -_Noreturn void ia2_reinit_stack_err(int i); +__attribute__((__noreturn__)) void ia2_reinit_stack_err(int i); #define _IA2_INIT_RUNTIME(n) \ int ia2_n_pkeys_to_alloc = n; \ diff --git a/runtime/libia2/init.c b/runtime/libia2/init.c index 707efa649..62bf5c894 100644 --- a/runtime/libia2/init.c +++ b/runtime/libia2/init.c @@ -66,7 +66,7 @@ void ensure_pkeys_allocated(int *n_to_alloc) { } /* Forbid overwriting an existing stack. */ -_Noreturn void ia2_reinit_stack_err(int i) { +__attribute__((__noreturn__)) void ia2_reinit_stack_err(int i) { printf("compartment %d in thread %d tried to allocate existing stack\n", i, gettid()); exit(1);