mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 07:35:14 +00:00
kbuild: Disable -Wpointer-to-enum-cast
commit82f2bc2fcc
upstream. Clang's -Wpointer-to-int-cast deviates from GCC in that it warns when casting to enums. The kernel does this in certain places, such as device tree matches to set the version of the device being used, which allows the kernel to avoid using a gigantic union. https://elixir.bootlin.com/linux/v5.5.8/source/drivers/ata/ahci_brcm.c#L428 https://elixir.bootlin.com/linux/v5.5.8/source/drivers/ata/ahci_brcm.c#L402 https://elixir.bootlin.com/linux/v5.5.8/source/include/linux/mod_devicetable.h#L264 To avoid a ton of false positive warnings, disable this particular part of the warning, which has been split off into a separate diagnostic so that the entire warning does not need to be turned off for clang. It will be visible under W=1 in case people want to go about fixing these easily and enabling the warning treewide. Cc: stable@vger.kernel.org Link: https://github.com/ClangBuiltLinux/linux/issues/887 Link:2a41b31fcd
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3b2c4f1122
commit
af6bdc2a85
1 changed files with 1 additions and 0 deletions
|
@ -72,5 +72,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, format)
|
|||
KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast)
|
||||
endif
|
||||
endif
|
||||
|
|
Loading…
Reference in a new issue