From bed51d856a516af06be3bbbfd3b9592eb53fd848 Mon Sep 17 00:00:00 2001 From: sin-ack Date: Tue, 3 Aug 2021 20:02:19 +0000 Subject: [PATCH] AK+Kernel: Print TODO when a TODO() is executed Previously we would just print "ASSERTION FAILED: false", which was kinda cryptic and also didn't make it clear whether this was a TODO or an unreachable condition. Now, we actually print "ASSERTION FAILED: TODO", making it crystal clear. --- AK/Assertions.h | 3 ++- Kernel/Assertions.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/AK/Assertions.h b/AK/Assertions.h index 4aee5d8429b..fbe3a86d70a 100644 --- a/AK/Assertions.h +++ b/AK/Assertions.h @@ -12,5 +12,6 @@ # include # define VERIFY assert # define VERIFY_NOT_REACHED() assert(false) -# define TODO VERIFY_NOT_REACHED +static constexpr bool TODO = false; +# define TODO() VERIFY(TODO) #endif diff --git a/Kernel/Assertions.h b/Kernel/Assertions.h index 436f13a9890..6ebab7fa5b7 100644 --- a/Kernel/Assertions.h +++ b/Kernel/Assertions.h @@ -25,4 +25,6 @@ extern "C" { #define VERIFY_INTERRUPTS_DISABLED() VERIFY(!(cpu_flags() & 0x200)) #define VERIFY_INTERRUPTS_ENABLED() VERIFY(cpu_flags() & 0x200) -#define TODO VERIFY_NOT_REACHED + +static constexpr bool TODO = false; +#define TODO() VERIFY(TODO)