[Mesa-dev] [PATCH] mesa: Define helper function to get the number of texture layers.

Matt Turner mattst88 at gmail.com
Tue Dec 10 18:31:55 PST 2013


On Tue, Dec 10, 2013 at 5:55 PM, Francisco Jerez <currojerez at riseup.net> wrote:
> It just seems annoying and unnecessary to me to have to repeat the same
> pattern before each use of unreachable().  If by definition the
> unreachable macro wants to be accompanied with an assert, why don't we
> save ourselves pain by having unreachable take care of both things you
> mentioned?
>
>> I don't particularly like the idea of modifying unreachable to take a
>> string to print.
>
> There's some precedent for this, see for example LLVM's unreachable
> macro [1].  It turns out that it does roughly what my proposed patch
> does: print an error message and abort on debug builds and call
> __builtin_unreachable() on release builds.
>
> [1] http://llvm.org/svn/llvm-project/llvm/trunk/include/llvm/Support/ErrorHandling.h

Yeah, okay. I just looked through the kernel and didn't find any uses
of unreachable() combined with assert() or similar.

So what you suggest seems fine to me.


More information about the mesa-dev mailing list