On Wed, Oct 12, 2016 at 12:41 PM, Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> wrote:
On ti, 2016-10-11 at 12:03 -0700, Robert Bragg wrote:
> > > + case DRM_I915_PERF_PROP_MAX:
> > > + BUG();
> >
> > We already handle this case above, but I guess we still need this in
> > order to silence gcc...
>
> right, and preferable to having a default: case, for the future compiler warning to handle any new properties here.
Please, do use MISSING_CASE instead. Daniel is known to get upset for
far less ;)
Generally consensus is that BUG() is used only when there're no other options to back out.
thanks for this pointer.
I'll add a default: with MISSING_CASE as that looks like an i915-specific convention; though it seems like a real shame to defer missing case issues to runtime errors instead of taking advantage of the compiler complaining at build time that a case has been forgotten.
Thanks,
- Robert
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel