diff options
author | Arnd Bergmann <arnd@arndb.de> | 2023-08-11 16:03:24 +0200 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2023-08-20 07:16:59 +0200 |
commit | 26030cb984dd65e0cb2d0c2489d94941cf8897b4 (patch) | |
tree | 19ae6a79e2c510a0affe7c6a61460529b56f0058 /scripts | |
parent | extrawarn: enable format and stringop overflow warnings in W=1 (diff) | |
download | linux-26030cb984dd65e0cb2d0c2489d94941cf8897b4.tar.xz linux-26030cb984dd65e0cb2d0c2489d94941cf8897b4.zip |
extrawarn: move -Wrestrict into W=1 warnings
There are few of these, so enable them whenever W=1 is enabled.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.extrawarn | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 4c734bba6e90..2fe6f2828d37 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -54,9 +54,6 @@ KBUILD_CFLAGS += -Wno-pointer-sign # globally built with -Wcast-function-type. KBUILD_CFLAGS += $(call cc-option, -Wcast-function-type) -# Another good warning that we'll want to enable eventually -KBUILD_CFLAGS += $(call cc-disable-warning, restrict) - # The allocators already balk at large sizes, so silence the compiler # warnings for bounds checks involving those possible values. While # -Wno-alloc-size-larger-than would normally be used here, earlier versions @@ -99,6 +96,7 @@ ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),) KBUILD_CFLAGS += -Wextra -Wunused -Wno-unused-parameter KBUILD_CFLAGS += -Wmissing-declarations +KBUILD_CFLAGS += $(call cc-option, -Wrestrict) KBUILD_CFLAGS += -Wmissing-format-attribute KBUILD_CFLAGS += -Wmissing-prototypes KBUILD_CFLAGS += -Wold-style-definition @@ -120,6 +118,7 @@ else # Suppress them by using -Wno... except for W=1. KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) +KBUILD_CFLAGS += $(call cc-disable-warning, restrict) KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned) KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation) |