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:
parent
014b9fd709
commit
f157ad8a35
Notes:
sideshowbarker
2024-07-17 11:59:59 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/f157ad8a35 Pull-request: https://github.com/SerenityOS/serenity/pull/13954 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/EWouters Reviewed-by: https://github.com/timschumi ✅
1 changed files with 2 additions and 3 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue