Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: Drop superfluous compiler option checks

Many of the compiler option checks are not necessary anymore with the
current supported versions of compilers (clang 15+, GCC 8.1+).

Remove them.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20260113-kbuild-cc-option-v1-1-011314a0f7f1@weissschuh.net
[nathan: Add minor note about currently supported compilers]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>

authored by

Thomas Weißschuh and committed by
Nathan Chancellor
379b749a 76df6815

+11 -14
+1 -1
Makefile
··· 1102 1102 1103 1103 # change __FILE__ to the relative path to the source directory 1104 1104 ifdef building_out_of_srctree 1105 - KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srcroot)/=) 1105 + KBUILD_CPPFLAGS += -fmacro-prefix-map=$(srcroot)/= 1106 1106 endif 1107 1107 1108 1108 # include additional Makefiles when needed
+10 -13
scripts/Makefile.warn
··· 16 16 KBUILD_CFLAGS += -Werror=strict-prototypes 17 17 KBUILD_CFLAGS += -Wno-format-security 18 18 KBUILD_CFLAGS += -Wno-trigraphs 19 - KBUILD_CFLAGS += $(call cc-option, -Wno-frame-address) 19 + KBUILD_CFLAGS += -Wno-frame-address 20 20 KBUILD_CFLAGS += $(call cc-option, -Wno-address-of-packed-member) 21 21 KBUILD_CFLAGS += -Wmissing-declarations 22 22 KBUILD_CFLAGS += -Wmissing-prototypes ··· 75 75 # In order to make sure new function cast mismatches are not introduced 76 76 # in the kernel (to avoid tripping CFI checking), the kernel should be 77 77 # globally built with -Wcast-function-type. 78 - KBUILD_CFLAGS += $(call cc-option, -Wcast-function-type) 78 + KBUILD_CFLAGS += -Wcast-function-type 79 79 80 80 # Currently, disable -Wstringop-overflow for GCC 11, globally. 81 81 KBUILD_CFLAGS-$(CONFIG_CC_NO_STRINGOP_OVERFLOW) += $(call cc-option, -Wno-stringop-overflow) ··· 102 102 KBUILD_CFLAGS += -Werror=date-time 103 103 104 104 # enforce correct pointer usage 105 - KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types) 105 + KBUILD_CFLAGS += -Werror=incompatible-pointer-types 106 106 107 107 # Require designated initializers for all marked structures 108 108 KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) ··· 119 119 120 120 KBUILD_CFLAGS += -Wmissing-format-attribute 121 121 KBUILD_CFLAGS += -Wmissing-include-dirs 122 - KBUILD_CFLAGS += $(call cc-option, -Wunused-const-variable) 122 + KBUILD_CFLAGS += -Wunused-const-variable 123 123 124 124 KBUILD_CPPFLAGS += -Wundef 125 125 KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1 ··· 128 128 129 129 # Some diagnostics enabled by default are noisy. 130 130 # Suppress them by using -Wno... except for W=1. 131 - KBUILD_CFLAGS += $(call cc-option, -Wno-unused-but-set-variable) 132 - KBUILD_CFLAGS += $(call cc-option, -Wno-unused-const-variable) 131 + KBUILD_CFLAGS += -Wno-unused-but-set-variable 132 + KBUILD_CFLAGS += -Wno-unused-const-variable 133 133 KBUILD_CFLAGS += $(call cc-option, -Wno-packed-not-aligned) 134 134 KBUILD_CFLAGS += $(call cc-option, -Wno-format-overflow) 135 135 ifdef CONFIG_CC_IS_GCC 136 - KBUILD_CFLAGS += $(call cc-option, -Wno-format-truncation) 136 + KBUILD_CFLAGS += -Wno-format-truncation 137 137 endif 138 138 KBUILD_CFLAGS += $(call cc-option, -Wno-stringop-truncation) 139 139 ··· 148 148 # problematic. 149 149 KBUILD_CFLAGS += -Wformat-extra-args -Wformat-invalid-specifier 150 150 KBUILD_CFLAGS += -Wformat-zero-length -Wnonnull 151 - # Requires clang-12+. 152 - ifeq ($(call clang-min-version, 120000),y) 153 151 KBUILD_CFLAGS += -Wformat-insufficient-args 154 152 endif 155 - endif 156 - KBUILD_CFLAGS += $(call cc-option, -Wno-pointer-to-enum-cast) 153 + KBUILD_CFLAGS += -Wno-pointer-to-enum-cast 157 154 KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare 158 - KBUILD_CFLAGS += $(call cc-option, -Wno-unaligned-access) 155 + KBUILD_CFLAGS += -Wno-unaligned-access 159 156 KBUILD_CFLAGS += -Wno-enum-compare-conditional 160 157 endif 161 158 ··· 166 169 KBUILD_CFLAGS += -Wdisabled-optimization 167 170 KBUILD_CFLAGS += -Wshadow 168 171 KBUILD_CFLAGS += $(call cc-option, -Wlogical-op) 169 - KBUILD_CFLAGS += $(call cc-option, -Wunused-macros) 172 + KBUILD_CFLAGS += -Wunused-macros 170 173 171 174 KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN2 172 175