[Mesa-dev] [PATCH 1/4] linker: Trivial coding standards fixes

Ilia Mirkin imirkin at alum.mit.edu
Tue Nov 8 13:25:08 UTC 2016


On Tue, Nov 8, 2016 at 12:50 AM, Ian Romanick <idr at freedesktop.org> wrote:
> -   virtual void visit_field(const glsl_type *type, const char *name,
> -                            bool row_major)
> +   virtual void visit_field(const glsl_type *, const char *,
> +                            bool /* row_major */)
>     {
> -      (void) type;
> -      (void) name;
> -      (void) row_major;
> -      assert(!"Should not get here.");
> +      unreachable("Should not get here.");
>     }

I'd be in favor of leaving this as an assert. The unreachable gets you
nothing here, except potential infinite loops on production builds
should this path ever get hit somehow.

I think people have started going overboard with unreachable... it
really should be for "shut up compiler, this can't happen, you're just
too dumb to see it" cases. Not for "it would be a bug to hit this
path" cases.

  -ilia


More information about the mesa-dev mailing list