Skip to content

Commit 7599ea8

Browse files
Lee JonesMichal Marek
authored andcommitted
kbuild: Demote 'sign-compare' warning to W=2
Ideally, a kernel compile with W=1 enabled should complete cleanly; however, when we run one currently we are presented with ~25k warnings. 'sign-compare' accounts for ~22k of those ~25k. In this patch we're demoting 'sign-compare' warnings to W=2, with a view to fixing the remaining 3k W=1 warnings required for a clean build. Arnd adds: "As per our discussion, I'd add that this was inadvertedly introduced by Behan when he moved the clang specific warnings into an ifdef block and did not notice that -Wsign-compare was interpreted by both gcc and clang. Earlier, it was introduced in just the same way by Jan-Simon as part of 3d3d6b8 ("kbuild: LLVMLinux: Adapt warnings for compilation with clang")." Acked-by: Arnd Bergmann <arnd@arndb.de> Fixes: 26ea6bb ("kbuild, LLVMLinux: Supress warnings unless W=1-3") Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Michal Marek <mmarek@suse.com>
1 parent 40ab87a commit 7599ea8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎scripts/Makefile.extrawarn‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ warning-1 += -Wold-style-definition
2525
warning-1 += $(call cc-option, -Wmissing-include-dirs)
2626
warning-1 += $(call cc-option, -Wunused-but-set-variable)
2727
warning-1 += $(call cc-disable-warning, missing-field-initializers)
28+
warning-1 += $(call cc-disable-warning, sign-compare)
2829

2930
warning-2 := -Waggregate-return
3031
warning-2 += -Wcast-align
@@ -33,6 +34,7 @@ warning-2 += -Wnested-externs
3334
warning-2 += -Wshadow
3435
warning-2 += $(call cc-option, -Wlogical-op)
3536
warning-2 += $(call cc-option, -Wmissing-field-initializers)
37+
warning-2 += $(call cc-option, -Wsign-compare)
3638

3739
warning-3 := -Wbad-function-cast
3840
warning-3 += -Wcast-qual

0 commit comments

Comments
 (0)