Skip to content

Commit 01367e8

Browse files
committed
Merge tag 'Wcast-function-type-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux
Pull cast-function-type warning addition from Gustavo A. R. Silva: "This globally enables -Wcast-function-type. We need to make sure new function cast mismatches are not introduced in the kernel in order to avoid tripping CFI checking" * tag 'Wcast-function-type-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: Makefile: Enable -Wcast-function-type
2 parents 3e3a138 + 552a23a commit 01367e8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,11 @@ KBUILD_CFLAGS += -Wvla
953953
# disable pointer signed / unsigned warnings in gcc 4.0
954954
KBUILD_CFLAGS += -Wno-pointer-sign
955955

956+
# In order to make sure new function cast mismatches are not introduced
957+
# in the kernel (to avoid tripping CFI checking), the kernel should be
958+
# globally built with -Wcast-function-type.
959+
KBUILD_CFLAGS += $(call cc-option, -Wcast-function-type)
960+
956961
# disable stringop warnings in gcc 8+
957962
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
958963

0 commit comments

Comments
 (0)