From adf26a24a7e63a6c1061c107ce60a384eb6500c7 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 31 Jul 2025 07:10:09 +0900 Subject: feat: output filename and line number from unreachable() and unimplemented() --- common.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'common.c') diff --git a/common.c b/common.c index 965c020..6b1cb8f 100644 --- a/common.c +++ b/common.c @@ -7,13 +7,9 @@ void fatal_error(const char* msg, ...) { exit(1); } -void unreachable() { - fatal_error("unreachable"); -} +#define unreachable() fatal_error("%s:%d: unreachable", __FILE__, __LINE__) -void unimplemented() { - fatal_error("unimplemented"); -} +#define unimplemented() fatal_error("%s:%d: unimplemented", __FILE__, __LINE__) struct String { char* data; -- cgit v1.2.3-70-g09d2