On 10 December 2013 08:42, Francisco Jerez <curroje...@riseup.net> wrote:

> Brian Paul <bri...@vmware.com> writes:
>
> > On 12/07/2013 06:17 PM, Francisco Jerez wrote:
> >>[...]
> >> +   default:
> >> +      unreachable();
> >
> > I think I'd like to see an assertion or _mesa_problem() call to catch
> > unhandled cases if new texture targets are added in the future.
> >
> >
> How about having the unreachable() macro print out an error and abort if
> it's ever reached?  See the attached patch.
>

I would prefer for us to simply do this:

assert(!"Unexpected texture target");
unreachable();

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().
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to