Skip to content

Commit 355a358

Browse files
rikardfalkeborntorvalds
authored andcommitted
kbuild: Move -Wtype-limits to W=2
-Wtype-limits is included in -Wextra which is added at W=1. It warns (among other things) that 'comparison of an unsigned variable `< 0` is always false. This causes noisy warnings, especially when used in macros, hence it is more suitable for W=2. Link: https://lore.kernel.org/lkml/CAHk-=wiKCXEWKJ9dWUimGbrVRo_N2RosESUw8E7m9AEtyZcu=w@mail.gmail.com/ Signed-off-by: Rikard Falkeborn <[email protected]> Suggested-by: Arnd Bergmann <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2a89b99 commit 355a358

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/Makefile.extrawarn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation)
3535
# The following turn off the warnings enabled by -Wextra
3636
KBUILD_CFLAGS += -Wno-missing-field-initializers
3737
KBUILD_CFLAGS += -Wno-sign-compare
38+
KBUILD_CFLAGS += -Wno-type-limits
3839

3940
KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1
4041

@@ -66,6 +67,7 @@ KBUILD_CFLAGS += -Wshadow
6667
KBUILD_CFLAGS += $(call cc-option, -Wlogical-op)
6768
KBUILD_CFLAGS += -Wmissing-field-initializers
6869
KBUILD_CFLAGS += -Wsign-compare
70+
KBUILD_CFLAGS += -Wtype-limits
6971
KBUILD_CFLAGS += $(call cc-option, -Wmaybe-uninitialized)
7072
KBUILD_CFLAGS += $(call cc-option, -Wunused-macros)
7173

0 commit comments

Comments
 (0)