Kernel: Do not implement VERIFY_NOT_REACHED() as VERIFY(false)

If a switch case ends in VERIFY_NOT_REACHED(), gcc 12 thinks it might
fall through.
This commit is contained in:
Daniel Bertalan 2022-05-07 17:46:27 +02:00 committed by Andreas Kling
parent 014b9fd709
commit f157ad8a35
Notes: sideshowbarker 2024-07-17 11:59:59 +09:00

View file

@ -18,15 +18,14 @@
__assertion_failed(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
} while (0)
#define VERIFY_NOT_REACHED() VERIFY(false)
#define VERIFY_NOT_REACHED() __assertion_failed("not reached", __FILE__, __LINE__, __PRETTY_FUNCTION__)
extern "C" {
[[noreturn]] void _abort();
[[noreturn]] void abort();
}
static constexpr bool TODO = false;
#define TODO() VERIFY(TODO)
#define TODO() __assertion_failed("TODO", __FILE__, __LINE__, __PRETTY_FUNCTION__)
#if ARCH(I386) || ARCH(X86_64)
# define VERIFY_INTERRUPTS_DISABLED() VERIFY(!(cpu_flags() & 0x200))