@@ -16,8 +16,8 @@ KBUILD_CFLAGS += -Werror=return-type
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-disable-warning, frame-address)
20
- KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
19
+ KBUILD_CFLAGS += $(call cc-option, -Wno- frame-address)
20
+ KBUILD_CFLAGS += $(call cc-option, -Wno- address-of-packed-member)
21
21
KBUILD_CFLAGS += -Wmissing-declarations
22
22
KBUILD_CFLAGS += -Wmissing-prototypes
23
23
@@ -35,8 +35,8 @@ KBUILD_CFLAGS += -Wno-gnu
35
35
36
36
# Clang checks for overflow/truncation with '%p', while GCC does not:
37
37
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111219
38
- KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow-non-kprintf)
39
- KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation-non-kprintf)
38
+ KBUILD_CFLAGS += $(call cc-option, -Wno- format-overflow-non-kprintf)
39
+ KBUILD_CFLAGS += $(call cc-option, -Wno- format-truncation-non-kprintf)
40
40
41
41
# Clang may emit a warning when a const variable, such as the dummy variables
42
42
# in typecheck(), or const member of an aggregate type are not initialized,
@@ -48,15 +48,15 @@ KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation-non-kprintf)
48
48
# disabled with this same switch, there should not be too much coverage lost
49
49
# because -Wuninitialized will still flag when an uninitialized const variable
50
50
# is used.
51
- KBUILD_CFLAGS += $(call cc-disable-warning, default-const-init-unsafe)
51
+ KBUILD_CFLAGS += $(call cc-option, -Wno- default-const-init-unsafe)
52
52
else
53
53
54
54
# gcc inanely warns about local variables called 'main'
55
55
KBUILD_CFLAGS += -Wno-main
56
56
endif
57
57
58
58
# These result in bogus false positives
59
- KBUILD_CFLAGS += $(call cc-disable-warning, dangling-pointer)
59
+ KBUILD_CFLAGS += $(call cc-option, -Wno- dangling-pointer)
60
60
61
61
# Variable Length Arrays (VLAs) should not be used anywhere in the kernel
62
62
KBUILD_CFLAGS += -Wvla
@@ -70,11 +70,11 @@ KBUILD_CFLAGS += -Wno-pointer-sign
70
70
KBUILD_CFLAGS += $(call cc-option, -Wcast-function-type)
71
71
72
72
# Currently, disable -Wstringop-overflow for GCC 11, globally.
73
- KBUILD_CFLAGS-$(CONFIG_CC_NO_STRINGOP_OVERFLOW) += $(call cc-disable-warning, stringop-overflow)
73
+ KBUILD_CFLAGS-$(CONFIG_CC_NO_STRINGOP_OVERFLOW) += $(call cc-option, -Wno- stringop-overflow)
74
74
KBUILD_CFLAGS-$(CONFIG_CC_STRINGOP_OVERFLOW) += $(call cc-option, -Wstringop-overflow)
75
75
76
76
# Currently, disable -Wunterminated-string-initialization as broken
77
- KBUILD_CFLAGS += $(call cc-disable-warning, unterminated-string-initialization)
77
+ KBUILD_CFLAGS += $(call cc-option, -Wno- unterminated-string-initialization)
78
78
79
79
# The allocators already balk at large sizes, so silence the compiler
80
80
# warnings for bounds checks involving those possible values. While
@@ -120,14 +120,14 @@ else
120
120
121
121
# Some diagnostics enabled by default are noisy.
122
122
# Suppress them by using -Wno... except for W=1.
123
- KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
124
- KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
125
- KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)
126
- KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
123
+ KBUILD_CFLAGS += $(call cc-option, -Wno- unused-but-set-variable)
124
+ KBUILD_CFLAGS += $(call cc-option, -Wno- unused-const-variable)
125
+ KBUILD_CFLAGS += $(call cc-option, -Wno- packed-not-aligned)
126
+ KBUILD_CFLAGS += $(call cc-option, -Wno- format-overflow)
127
127
ifdef CONFIG_CC_IS_GCC
128
- KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
128
+ KBUILD_CFLAGS += $(call cc-option, -Wno- format-truncation)
129
129
endif
130
- KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
130
+ KBUILD_CFLAGS += $(call cc-option, -Wno- stringop-truncation)
131
131
132
132
KBUILD_CFLAGS += -Wno-override-init # alias for -Wno-initializer-overrides in clang
133
133
@@ -145,9 +145,9 @@ ifeq ($(call clang-min-version, 120000),y)
145
145
KBUILD_CFLAGS += -Wformat-insufficient-args
146
146
endif
147
147
endif
148
- KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast)
148
+ KBUILD_CFLAGS += $(call cc-option, -Wno- pointer-to-enum-cast)
149
149
KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare
150
- KBUILD_CFLAGS += $(call cc-disable-warning, unaligned-access)
150
+ KBUILD_CFLAGS += $(call cc-option, -Wno- unaligned-access)
151
151
KBUILD_CFLAGS += -Wno-enum-compare-conditional
152
152
endif
153
153
0 commit comments