[Intel-gfx] [PATCH 1/3] drm/i915: copy-paste the extra warnings from scripts/Makefile.extrawarn

Jani Nikula jani.nikula at intel.com
Thu Jun 8 11:22:31 UTC 2023


We enable a lot more compiler warnings than the kernel defaults. A lot
of them are comparable with the W=1 warnings (and warning disables!) in
scripts/Makefile.extrawarn. Copy-paste them with
s/KBUILD_CFLAGS/subdir-ccflags-y/ to make it easier to compare. Some of
them overlap with the -Wall we also add, but it doesn't really matter.

Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/i915/Makefile | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 789dce9e2608..690308dc7047 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -12,15 +12,30 @@
 # Note the danger in using -Wall -Wextra is that when CI updates gcc we
 # 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 += -Wno-format-security
-subdir-ccflags-y += -Wno-unused-parameter
-subdir-ccflags-y += -Wno-type-limits
+subdir-ccflags-y := -Wall
+
+# begin copy-paste W=1 warnings from scripts/Makefile.extrawarn
+subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter
+subdir-ccflags-y += -Wmissing-declarations
+subdir-ccflags-y += -Wmissing-format-attribute
+subdir-ccflags-y += -Wmissing-prototypes
+subdir-ccflags-y += -Wold-style-definition
+subdir-ccflags-y += -Wmissing-include-dirs
+subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable)
+subdir-ccflags-y += $(call cc-option, -Wunused-const-variable)
+subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned)
+subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
+# The following turn off the warnings enabled by -Wextra
 subdir-ccflags-y += -Wno-missing-field-initializers
 subdir-ccflags-y += -Wno-sign-compare
+subdir-ccflags-y += -Wno-type-limits
 subdir-ccflags-y += -Wno-shift-negative-value
-subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable)
+# end copy-paste
+
+# The following turn off the warnings enabled by -Wall
+subdir-ccflags-y += -Wno-format-security
 subdir-ccflags-y += $(call cc-disable-warning, frame-address)
+
 subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
 
 subdir-ccflags-y += -I$(srctree)/$(src)
-- 
2.39.2



More information about the Intel-gfx mailing list