Commit 7a8bc117 authored by Lucas De Marchi's avatar Lucas De Marchi Committed by Rodrigo Vivi

drm/xe: Enable W=1 warnings by default

Like done in commit 2250c7ea ("drm/i915: enable W=1 warnings by default")
for i915, enable W=1 warnings by default in xe.
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 73486d75
...@@ -3,25 +3,34 @@ ...@@ -3,25 +3,34 @@
# Makefile for the drm device driver. This driver provides support for the # Makefile for the drm device driver. This driver provides support for the
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
# Add a set of useful warning flags and enable -Werror for CI to prevent # Unconditionally enable W=1 warnings locally
# trivial mistakes from creeping in. We have to do this piecemeal as we reject # --- begin copy-paste W=1 warnings from scripts/Makefile.extrawarn
# any patch that isn't warning clean, so turning on -Wall -Wextra (or W=1) we subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter
# need to filter out dubious warnings. Still it is our interest subdir-ccflags-y += -Wmissing-declarations
# to keep running locally with W=1 C=1 until we are completely clean. subdir-ccflags-y += $(call cc-option, -Wrestrict)
# subdir-ccflags-y += -Wmissing-format-attribute
# Note the danger in using -Wall -Wextra is that when CI updates gcc we subdir-ccflags-y += -Wmissing-prototypes
# will most likely get a sudden build breakage... Hopefully we will fix subdir-ccflags-y += -Wold-style-definition
# new warnings before CI updates! subdir-ccflags-y += -Wmissing-include-dirs
subdir-ccflags-y := -Wall -Wextra subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable)
subdir-ccflags-y += $(call cc-disable-warning, unused-parameter) subdir-ccflags-y += $(call cc-option, -Wunused-const-variable)
subdir-ccflags-y += $(call cc-disable-warning, type-limits) subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned)
subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers) subdir-ccflags-y += $(call cc-option, -Wformat-overflow)
subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable) subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
# clang warnings subdir-ccflags-y += $(call cc-option, -Wstringop-overflow)
subdir-ccflags-y += $(call cc-disable-warning, sign-compare) subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
subdir-ccflags-y += $(call cc-disable-warning, sometimes-uninitialized) # The following turn off the warnings enabled by -Wextra
subdir-ccflags-y += $(call cc-disable-warning, initializer-overrides) ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)
subdir-ccflags-y += $(call cc-disable-warning, frame-address) subdir-ccflags-y += -Wno-missing-field-initializers
subdir-ccflags-y += -Wno-type-limits
subdir-ccflags-y += -Wno-shift-negative-value
endif
ifeq ($(findstring 3, $(KBUILD_EXTRA_WARN)),)
subdir-ccflags-y += -Wno-sign-compare
endif
# --- end copy-paste
# Enable -Werror in CI and development
subdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror subdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror
subdir-ccflags-y += -I$(obj) -I$(srctree)/$(src) subdir-ccflags-y += -I$(obj) -I$(srctree)/$(src)
......
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