<div dir="ltr">On 10 December 2013 08:42, Francisco Jerez <span dir="ltr"><<a href="mailto:currojerez@riseup.net" target="_blank">currojerez@riseup.net</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">Brian Paul <<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>> writes:<br>

<br>
> On 12/07/2013 06:17 PM, Francisco Jerez wrote:<br>
</div>>>[...]<br>
<div class="im">>> +   default:<br>
>> +      unreachable();<br>
><br>
> I think I'd like to see an assertion or _mesa_problem() call to catch<br>
> unhandled cases if new texture targets are added in the future.<br>
><br>
><br>
</div>How about having the unreachable() macro print out an error and abort if<br>
it's ever reached?  See the attached patch.<br></blockquote><div><br></div><div>I would prefer for us to simply do this:<br><br></div><div>assert(!"Unexpected texture target");<br></div><div>unreachable();<br>
<br></div><div>That would have the exact same semantics as your proposed patch (assert in debug builds, allow compiler optimizations in release builds), and it would have the added advantage that it's obvious what's going on to someone reading the code.  With your proposed patch it's not obvious--the reader has to be aware that Mesa has a non-standard meaning for unreachable().<br>
</div></div></div></div>