Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Feb 2020 20:45:23 +0100
From:      Joerg Sonnenberger <joerg@bec.de>
To:        svn-src-all@freebsd.org
Subject:   Re: svn commit: r358248 - head/sys/vm
Message-ID:  <20200222194523.GD11584@bec.de>
In-Reply-To: <63F5EABB-78D3-4DA5-B306-CF12CC3A6FAF@andric.com>
References:  <202002221620.01MGK46E072303@repo.freebsd.org> <a3b2125de10d214d6e422d183f1fdc7e0e38e014.camel@freebsd.org> <CACNAnaHZnrqRv9J-B7XRCc7eN7Hkccf1R-7e36LiAXvZR4etVw@mail.gmail.com> <CAGudoHHg5R0zOc7RYge36roz%2B3C_sSRZcsyXC55W0yAyQpuuBA@mail.gmail.com> <6D39FAD8-E581-42A8-97B4-EE63800D78A4@andric.com> <b5a0d991f1d03e6cac2f7e0c1c54ac83124e8ca0.camel@freebsd.org> <63F5EABB-78D3-4DA5-B306-CF12CC3A6FAF@andric.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200222194523.GD11584>