freebsd-skq/sys/dev/nvdimm
Kyle Evans c79cee7136 kernel: provide panicky version of __unreachable
__builtin_unreachable doesn't raise any compile-time warnings/errors on its
own, so problems with its usage can't be easily detected. While it would be
nice for this situation to change and compilers to at least add a warning
for trivial cases where local state means the instruction can't be reached,
this isn't the case at the moment and likely will not happen.

This commit adds an __assert_unreachable, whose intent is incredibly clear:
it asserts that this instruction is unreachable. On INVARIANTS builds, it's
a panic(), and on non-INVARIANTS it expands to  __unreachable().

Existing users of __unreachable() are converted to __assert_unreachable,
to improve debuggability if this assumption is violated.

Reviewed by:	mjg
Differential Revision:	https://reviews.freebsd.org/D23793
2020-05-13 18:07:37 +00:00
..
nvdimm_acpi.c
nvdimm_e820.c
nvdimm_nfit.c
nvdimm_ns.c
nvdimm_spa.c
nvdimm_var.h
nvdimm.c kernel: provide panicky version of __unreachable 2020-05-13 18:07:37 +00:00