File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,14 @@ KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
100
100
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
101
101
KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)
102
102
KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
103
+ ifdef CONFIG_CC_IS_GCC
103
104
KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
105
+ else
106
+ # Clang checks for overflow/truncation with '%p', while GCC does not:
107
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111219
108
+ KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow-non-kprintf)
109
+ KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation-non-kprintf)
110
+ endif
104
111
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
105
112
106
113
KBUILD_CFLAGS += -Wno-override-init # alias for -Wno-initializer-overrides in clang
You can’t perform that action at this time.
0 commit comments