Makefile.extrawarn (a1c613ae4c322ddd58d5a8539dbfba2a0380a8c0) Makefile.extrawarn (92ef432f027cffe0ff91ff2cbe9258d89ca53968)
1# SPDX-License-Identifier: GPL-2.0
2# ==========================================================================
3# make W=... settings
4#
5# There are four warning groups enabled by W=1, W=2, W=3, and W=e
6# They are independent, and can be combined like W=12 or W=123e.
7# ==========================================================================
8

--- 66 unchanged lines hidden (view full) ---

75KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)
76
77# Require designated initializers for all marked structures
78KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)
79
80# Warn if there is an enum types mismatch
81KBUILD_CFLAGS += $(call cc-option,-Wenum-conversion)
82
1# SPDX-License-Identifier: GPL-2.0
2# ==========================================================================
3# make W=... settings
4#
5# There are four warning groups enabled by W=1, W=2, W=3, and W=e
6# They are independent, and can be combined like W=12 or W=123e.
7# ==========================================================================
8

--- 66 unchanged lines hidden (view full) ---

75KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)
76
77# Require designated initializers for all marked structures
78KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)
79
80# Warn if there is an enum types mismatch
81KBUILD_CFLAGS += $(call cc-option,-Wenum-conversion)
82
83# backward compatibility
84KBUILD_EXTRA_WARN ?= $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)
85
86ifeq ("$(origin W)", "command line")
87 KBUILD_EXTRA_WARN := $(W)
88endif
89
90export KBUILD_EXTRA_WARN
91
92#
93# W=1 - warnings which may be relevant and do not occur too often
94#
95ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),)
96
97KBUILD_CFLAGS += -Wextra -Wunused -Wno-unused-parameter
98KBUILD_CFLAGS += -Wmissing-declarations
99KBUILD_CFLAGS += $(call cc-option, -Wrestrict)

--- 118 unchanged lines hidden ---
83#
84# W=1 - warnings which may be relevant and do not occur too often
85#
86ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),)
87
88KBUILD_CFLAGS += -Wextra -Wunused -Wno-unused-parameter
89KBUILD_CFLAGS += -Wmissing-declarations
90KBUILD_CFLAGS += $(call cc-option, -Wrestrict)

--- 118 unchanged lines hidden ---