svn commit: r358248 - head/sys/vm

Joerg Sonnenberger joerg at bec.de
Sat Feb 22 19:45:29 UTC 2020


On Sat, Feb 22, 2020 at 08:24:45PM +0100, Dimitry Andric wrote:
> It might be better to define our own UNREACHABLE macro, similar to what
> llvm itself does, roughly something like:
> 
> __noreturn void internal_unreachable(const char *, const char *, int);
> #define UNREACHABLE(msg) internal_unreachable(msg, __FILE__, __LINE__)
> 
> And have the implementation of internal_unreachable() log the file,
> line and message, then abort or panic in some appropriate way.

One way to deal with it is to use __builtin_trap() for debug builds and
__builtin_unreachable() otherwise. They both signify code that shouldn't
be reached, but they differ in how the compiler will use that knowledge.

Joerg


More information about the svn-src-all mailing list