Skip to content

Commit 26030cb

Browse files
arndbmasahir0y
authored andcommitted
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>
1 parent 6d4ab2e commit 26030cb

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

scripts/Makefile.extrawarn

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ KBUILD_CFLAGS += -Wno-pointer-sign
5454
# globally built with -Wcast-function-type.
5555
KBUILD_CFLAGS += $(call cc-option, -Wcast-function-type)
5656

57-
# Another good warning that we'll want to enable eventually
58-
KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
59-
6057
# The allocators already balk at large sizes, so silence the compiler
6158
# warnings for bounds checks involving those possible values. While
6259
# -Wno-alloc-size-larger-than would normally be used here, earlier versions
@@ -99,6 +96,7 @@ ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),)
9996

10097
KBUILD_CFLAGS += -Wextra -Wunused -Wno-unused-parameter
10198
KBUILD_CFLAGS += -Wmissing-declarations
99+
KBUILD_CFLAGS += $(call cc-option, -Wrestrict)
102100
KBUILD_CFLAGS += -Wmissing-format-attribute
103101
KBUILD_CFLAGS += -Wmissing-prototypes
104102
KBUILD_CFLAGS += -Wold-style-definition
@@ -120,6 +118,7 @@ else
120118
# Suppress them by using -Wno... except for W=1.
121119
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
122120
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
121+
KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
123122
KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)
124123
KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
125124
KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)

0 commit comments

Comments
 (0)