From b8660e1c02da92c315a17229d8983adc52c93129 Mon Sep 17 00:00:00 2001 From: Roman Venediktov Date: Sun, 30 Jun 2024 19:22:14 +0200 Subject: [PATCH] Added _Noreturn for failures --- runtime/runtime.c | 4 ++-- runtime/runtime.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/runtime.c b/runtime/runtime.c index 9b1a9260b..9f1fb999b 100644 --- a/runtime/runtime.c +++ b/runtime/runtime.c @@ -22,13 +22,13 @@ extern size_t __gc_stack_top, __gc_stack_bottom; assert(__builtin_frame_address(0) <= (void *)__gc_stack_top); \ if (flag) { __gc_stack_top = 0; } -static void vfailure (char *s, va_list args) { +_Noreturn static void vfailure (char *s, va_list args) { fprintf(stderr, "*** FAILURE: "); vfprintf(stderr, s, args); // vprintf (char *, va_list) <-> printf (char *, ...) exit(255); } -void failure (char *s, ...) { +_Noreturn void failure (char *s, ...) { va_list args; va_start(args, s); diff --git a/runtime/runtime.h b/runtime/runtime.h index c378afc49..1cf9ad714 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -16,6 +16,6 @@ #define WORD_SIZE (CHAR_BIT * sizeof(ptrt)) -void failure (char *s, ...); +_Noreturn void failure (char *s, ...); #endif