On Wed, Jan 18, 2017 at 05:56:13PM +0200, Joonas Lahtinen wrote:
> On ke, 2017-01-18 at 12:18 +0000, Chris Wilson wrote:
> > We commonly use an inheritance style approach to device parameters,
> > where later generations inherit the defaults from earlier generations
> > and then override settings that change. For example, in i915_pci.c
> > BDW_FEATURES pulls in HSW_FEATURES, makes a few changes for 48bit
> > contexts and then individual Broadwell stanzas make further adjustments
> > for different GT configs.
> > 
> > This causes a lot of warnings with make W=1 from -Woverride-init. We
> > could use
> >     #pragma GCC diagnostic push
> >     #pragma GCC diagnostic ignored "-Woverride-init"
> >     ...
> >     #pragma GCC diagnostic pop
> > around the offenders, but the pattern is used frequently enough in the
> > driver to prefer just disabling the warning entirely.
> > 
> > Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
> > Cc: Joonas Lahtinen <joonas.lahti...@linux.intel.com
> > Cc: Jani Nikula <jani.nik...@intel.com>
> > Cc: Daniel Vetter <daniel.vet...@ffwll.ch>
> > Cc: Tomi Sarvela <tomi.p.sarv...@intel.com>
> 
> <SNIP>
>  
> > -subdir-ccflags-$(CONFIG_DRM_I915_WERROR) := -Werror
> > +subdir-ccflags-y := -Wno-override-init # used frequently for "inheritance"
> 
> Why always on, if somebody upper level decides to -Werror, this is
> kinda unexpected for them?

We intentionally use the { .a = 0, .a = 1 }. That is flagged by the set
of warnings enabled by W=1. If the user is using Werror, then they are
faced with an intentionally broken build.

Our choice, if we want to be W=1 clean, is to either markup using #pragma
or turn off the warning.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to