aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-07-31 07:10:09 +0900
committernsfisis <nsfisis@gmail.com>2025-08-15 10:06:21 +0900
commitadf26a24a7e63a6c1061c107ce60a384eb6500c7 (patch)
treed12d61e58c07cdb092951a4c05a592aeb3f9b1ae
parent6b1418634534bc3d7f32e63c88a186d030ab31f8 (diff)
downloadducc-adf26a24a7e63a6c1061c107ce60a384eb6500c7.tar.gz
ducc-adf26a24a7e63a6c1061c107ce60a384eb6500c7.tar.zst
ducc-adf26a24a7e63a6c1061c107ce60a384eb6500c7.zip
feat: output filename and line number from unreachable() and unimplemented()
-rw-r--r--common.c8
1 files changed, 2 insertions, 6 deletions
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;