public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Replace "cc-option -Wno-foo" with "cc-disable-warning foo"
@ 2017-10-30 17:29 Chris Wilson
  2017-10-30 17:41 ` Ville Syrjälä
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Chris Wilson @ 2017-10-30 17:29 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula

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: 39bf4de89ff7 ("drm/i915: Add -Wall -Wextra to our build, set warnings to full")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 7750be8e27a6..1bbc5440db40 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -12,15 +12,15 @@
 # will most likely get a sudden build breakage... Hopefully we will fix
 # new warnings before CI updates!
 subdir-ccflags-y := -Wall -Wextra
-subdir-ccflags-y += $(call cc-option,-Wno-unused-parameter,)
-subdir-ccflags-y += $(call cc-option,-Wno-type-limits,)
-subdir-ccflags-y += $(call cc-option,-Wno-missing-field-initializers,)
-subdir-ccflags-y += $(call cc-option,-Wno-implicit-fallthrough,)
+subdir-ccflags-y += $(call cc-disable-warning, unused-parameter)
+subdir-ccflags-y += $(call cc-disable-warning, type-limits)
+subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers)
+subdir-ccflags-y += $(call cc-disable-warning, implicit-fallthrough)
 subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
 
 # Fine grained warnings disable
-CFLAGS_i915_pci.o = $(call cc-option,-Wno-override-init,)
-CFLAGS_intel_fbdev.o = $(call cc-option,-Wno-override-init,)
+CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)
+CFLAGS_intel_fbdev.o = $(call cc-disable-warning, override-init)
 
 subdir-ccflags-y += \
 	$(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA)
-- 
2.15.0.rc2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-10-31 13:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-30 17:29 [PATCH] drm/i915: Replace "cc-option -Wno-foo" with "cc-disable-warning foo" Chris Wilson
2017-10-30 17:41 ` Ville Syrjälä
2017-10-30 21:25   ` Chris Wilson
2017-10-30 17:51 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-30 18:57 ` ✓ Fi.CI.IGT: " Patchwork
2017-10-30 22:43 ` ✓ Fi.CI.BAT: " Patchwork
2017-10-30 23:45 ` ✓ Fi.CI.IGT: " Patchwork
2017-10-31 13:22 ` [PATCH] " Joonas Lahtinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox