From 43f8c072241e162283751c28de18dc4658470d6e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 16 Apr 2025 13:58:37 -0400 Subject: Automatically add return for unreachable code blocks (following a _Noreturn) to make TinyCC happy --- src/stdlib/util.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/stdlib/util.h') diff --git a/src/stdlib/util.h b/src/stdlib/util.h index 25cd49f9..e54c1cab 100644 --- a/src/stdlib/util.h +++ b/src/stdlib/util.h @@ -21,6 +21,8 @@ #define WHEN(type, subj, var, body) { type var = subj; switch (var.$tag) body } +#define UNREACHABLE_RETURN(t) { errx(1, "Unreachable"); t _unreachable; return _unreachable; } + #ifndef public #define public __attribute__ ((visibility ("default"))) #endif -- cgit v1.2.3