Skip to content

Commit af0e5d5

Browse files
Dave Jonesmichal42
authored andcommitted
kbuild: Disable -Wunused-but-set-variable for gcc 4.6.0
Disable the new -Wunused-but-set-variable that was added in gcc 4.6.0 It produces more false positives than useful warnings. This can still be enabled using W=1 Signed-off-by: Dave Jones <davej@redhat.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent f077260 commit af0e5d5

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎Makefile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,10 @@ ifndef CONFIG_CC_STACKPROTECTOR
567567
KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
568568
endif
569569

570+
# This warning generated too much noise in a regular build.
571+
# Use make W=1 to enable this warning (see scripts/Makefile.build)
572+
KBUILD_CFLAGS += $(call cc-option, -Wno-unused-but-set-variable)
573+
570574
ifdef CONFIG_FRAME_POINTER
571575
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
572576
else

‎scripts/Makefile.build‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ warning-1 += -Wmissing-format-attribute
6666
warning-1 += -Wmissing-prototypes
6767
warning-1 += -Wold-style-definition
6868
warning-1 += $(call cc-option, -Wmissing-include-dirs)
69+
warning-1 += $(call cc-option, -Wunused-but-set-variable)
6970

7071
warning-2 := -Waggregate-return
7172
warning-2 += -Wcast-align

0 commit comments

Comments
 (0)