···10611061# perform bounds checking.10621062KBUILD_CFLAGS += $(call cc-option, -fstrict-flex-arrays=3)1063106310641064+# Allow including a tagged struct or union anonymously in another struct/union.10651065+KBUILD_CFLAGS += -fms-extensions10661066+10641067# disable invalid "can't wrap" optimizations for signed / pointers10651068KBUILD_CFLAGS += -fno-strict-overflow10661069
+2-1
arch/arm64/kernel/vdso32/Makefile
···6363 $(filter -Werror,$(KBUILD_CPPFLAGS)) \6464 -Werror-implicit-function-declaration \6565 -Wno-format-security \6666- -std=gnu116666+ -std=gnu11 -fms-extensions6767VDSO_CFLAGS += -O26868# Some useful compiler-dependent flags from top-level Makefile6969VDSO_CFLAGS += $(call cc32-option,-Wno-pointer-sign)···7171VDSO_CFLAGS += $(call cc32-option,-Werror=strict-prototypes)7272VDSO_CFLAGS += -Werror=date-time7373VDSO_CFLAGS += $(call cc32-option,-Werror=incompatible-pointer-types)7474+VDSO_CFLAGS += $(if $(CONFIG_CC_IS_CLANG),-Wno-microsoft-anon-tag)74757576# Compile as THUMB2 or ARM. Unwinding via frame-pointers in THUMB2 is7677# unreliable.
···48484949# How to compile the 16-bit code. Note we always compile for -march=i386;5050# that way we can complain to the user if the CPU is insufficient.5151-REALMODE_CFLAGS := -std=gnu11 -m16 -g -Os -DDISABLE_BRANCH_PROFILING -D__DISABLE_EXPORTS \5151+REALMODE_CFLAGS := -std=gnu11 -fms-extensions -m16 -g -Os \5252+ -DDISABLE_BRANCH_PROFILING -D__DISABLE_EXPORTS \5253 -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \5354 -fno-strict-aliasing -fomit-frame-pointer -fno-pic \5455 -mno-mmx -mno-sse $(call cc-option,-fcf-protection=none)···6160REALMODE_CFLAGS += $(CLANG_FLAGS)6261ifdef CONFIG_CC_IS_CLANG6362REALMODE_CFLAGS += -Wno-gnu6363+REALMODE_CFLAGS += -Wno-microsoft-anon-tag6464endif6565export REALMODE_CFLAGS6666
+5-2
arch/x86/boot/compressed/Makefile
···2525# avoid errors with '-march=i386', and future flags may depend on the target to2626# be valid.2727KBUILD_CFLAGS := -m$(BITS) -O2 $(CLANG_FLAGS)2828-KBUILD_CFLAGS += -std=gnu112828+KBUILD_CFLAGS += -std=gnu11 -fms-extensions2929KBUILD_CFLAGS += -fno-strict-aliasing -fPIE3030KBUILD_CFLAGS += -Wundef3131KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING···3636KBUILD_CFLAGS += -ffreestanding -fshort-wchar3737KBUILD_CFLAGS += -fno-stack-protector3838KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)3939-KBUILD_CFLAGS += $(call cc-disable-warning, gnu)3939+ifdef CONFIG_CC_IS_CLANG4040+KBUILD_CFLAGS += -Wno-gnu4141+KBUILD_CFLAGS += -Wno-microsoft-anon-tag4242+endif4043KBUILD_CFLAGS += -Wno-pointer-sign4144KBUILD_CFLAGS += -fno-asynchronous-unwind-tables4245KBUILD_CFLAGS += -D__DISABLE_EXPORTS
···7676 struct {7777 unchar _unused[16]; /* 16: */7878 dxd_t _dxd; /* 16: */7979- /* _inline may overflow into _inline_ea when needed */7979+ /* _inline_sym may overflow into _inline_ea when needed */8080 /* _inline_ea may overlay the last part of8181 * file._xtroot if maxentry = XTROOTINITSLOT8282 */8383 union {8484 struct {8585 /* 128: inline symlink */8686- unchar _inline[128];8686+ unchar _inline_sym[128];8787 /* 128: inline extended attr */8888 unchar _inline_ea[128];8989 };···101101#define i_imap u.file._imap102102#define i_dirtable u.dir._table103103#define i_dtroot u.dir._dtroot104104-#define i_inline u.link._inline104104+#define i_inline u.link._inline_sym105105#define i_inline_ea u.link._inline_ea106106#define i_inline_all u.link._inline_all107107
+3-1
scripts/Makefile.extrawarn
···2828KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds29293030ifdef CONFIG_CC_IS_CLANG3131-# The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable.3131+# The kernel builds with '-std=gnu11' and '-fms-extensions' so use of GNU and3232+# Microsoft extensions is acceptable.3233KBUILD_CFLAGS += -Wno-gnu3434+KBUILD_CFLAGS += -Wno-microsoft-anon-tag33353436# Clang checks for overflow/truncation with '%p', while GCC does not:3537# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111219