Skip to content

Commit

Permalink
runtime: use __attribute__((__noreturn__)) instead of _Noreturn t…
Browse files Browse the repository at this point in the history
…o 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.
  • Loading branch information
kkysen committed Oct 14, 2024
1 parent 40a9587 commit 0177cc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion runtime/libia2/include/ia2_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down
2 changes: 1 addition & 1 deletion runtime/libia2/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0177cc4

Please sign in to comment.