Commit 4ab09d0e authored by Chris Wilson's avatar Chris Wilson

drm/i915: Replace "cc-option -Wno-foo" with "cc-disable-warning foo"

To quote kbuild/makefiles.txt:

    cc-disable-warning checks if gcc supports a given warning and returns
    the commandline switch to disable it. This special function is needed,
    because gcc 4.4 and later accept any unknown -Wno-* option and only
    warn about it if there is another warning in the source file.

This is exactly what we were trying to achieve with cc-option -Wno-foo and
failed miserably.

Reported-by: kbuild-all@01.org
Fixes: 39bf4de8 ("drm/i915: Add -Wall -Wextra to our build, set warnings to full")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171030172927.18158-1-chris@chris-wilson.co.ukReviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
parent 35686a44
...@@ -12,15 +12,15 @@ ...@@ -12,15 +12,15 @@
# will most likely get a sudden build breakage... Hopefully we will fix # will most likely get a sudden build breakage... Hopefully we will fix
# new warnings before CI updates! # new warnings before CI updates!
subdir-ccflags-y := -Wall -Wextra subdir-ccflags-y := -Wall -Wextra
subdir-ccflags-y += $(call cc-option,-Wno-unused-parameter,) subdir-ccflags-y += $(call cc-disable-warning, unused-parameter)
subdir-ccflags-y += $(call cc-option,-Wno-type-limits,) subdir-ccflags-y += $(call cc-disable-warning, type-limits)
subdir-ccflags-y += $(call cc-option,-Wno-missing-field-initializers,) subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers)
subdir-ccflags-y += $(call cc-option,-Wno-implicit-fallthrough,) subdir-ccflags-y += $(call cc-disable-warning, implicit-fallthrough)
subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
# Fine grained warnings disable # Fine grained warnings disable
CFLAGS_i915_pci.o = $(call cc-option,-Wno-override-init,) CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)
CFLAGS_intel_fbdev.o = $(call cc-option,-Wno-override-init,) CFLAGS_intel_fbdev.o = $(call cc-disable-warning, override-init)
subdir-ccflags-y += \ subdir-ccflags-y += \
$(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA) $(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment