Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250748
b: refs/heads/master
c: 28bc20d
h: refs/heads/master
v: v3
  • Loading branch information
Sam Ravnborg authored and Michal Marek committed Apr 28, 2011
1 parent 18faf9f commit 85dabc7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40df759e2b9ec945f1a5ddc61b3fdfbb6583257e
refs/heads/master: 28bc20dccadc610c56e27255aeef2938141a0cd3
8 changes: 6 additions & 2 deletions trunk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ ifeq ("$(origin O)", "command line")
endif

ifeq ("$(origin W)", "command line")
export KBUILD_ENABLE_EXTRA_GCC_CHECKS := 1
export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W)
endif

# That's our default target when none is given on the command line
Expand Down Expand Up @@ -1274,7 +1274,11 @@ help:
@echo ' make O=dir [targets] Locate all output files in "dir", including .config'
@echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)'
@echo ' make C=2 [targets] Force check of all c source with $$CHECK'
@echo ' make W=1 [targets] Enable extra gcc checks'
@echo ' make W=n [targets] Enable extra gcc checks, n=1,2,3 where'
@echo ' 1: warnings which may be relevant and do not occur too often'
@echo ' 2: warnings which occur quite often but may still be relevant'
@echo ' 3: more obscure warnings, can most likely be ignored'

@echo ''
@echo 'Execute "make" or "make all" to build all targets marked with [*] '
@echo 'For further info see the ./README file'
Expand Down
65 changes: 38 additions & 27 deletions trunk/scripts/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -51,36 +51,47 @@ ifeq ($(KBUILD_NOPEDANTIC),)
endif

#
# make W=1 settings
# make W=... settings
#
# $(call cc-option... ) handles gcc -W.. options which
# W=1 - warnings that may be relevant and does not occur too often
# W=2 - warnings that occur quite often but may still be relevant
# W=3 - the more obscure warnings, can most likely be ignored
#
# $(call cc-option, -W...) handles gcc -W.. options which
# are not supported by all versions of the compiler
ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS
KBUILD_EXTRA_WARNINGS := -Wextra
KBUILD_EXTRA_WARNINGS += -Wunused -Wno-unused-parameter
KBUILD_EXTRA_WARNINGS += -Waggregate-return
KBUILD_EXTRA_WARNINGS += -Wbad-function-cast
KBUILD_EXTRA_WARNINGS += -Wcast-qual
KBUILD_EXTRA_WARNINGS += -Wcast-align
KBUILD_EXTRA_WARNINGS += -Wconversion
KBUILD_EXTRA_WARNINGS += -Wdisabled-optimization
KBUILD_EXTRA_WARNINGS += -Wlogical-op
KBUILD_EXTRA_WARNINGS += -Wmissing-declarations
KBUILD_EXTRA_WARNINGS += -Wmissing-format-attribute
KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wmissing-include-dirs,)
KBUILD_EXTRA_WARNINGS += -Wmissing-prototypes
KBUILD_EXTRA_WARNINGS += -Wnested-externs
KBUILD_EXTRA_WARNINGS += -Wold-style-definition
KBUILD_EXTRA_WARNINGS += $(call cc-option, -Woverlength-strings,)
KBUILD_EXTRA_WARNINGS += -Wpacked
KBUILD_EXTRA_WARNINGS += -Wpacked-bitfield-compat
KBUILD_EXTRA_WARNINGS += -Wpadded
KBUILD_EXTRA_WARNINGS += -Wpointer-arith
KBUILD_EXTRA_WARNINGS += -Wredundant-decls
KBUILD_EXTRA_WARNINGS += -Wshadow
KBUILD_EXTRA_WARNINGS += -Wswitch-default
KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wvla,)
KBUILD_CFLAGS += $(KBUILD_EXTRA_WARNINGS)
warning-1 := -Wextra -Wunused -Wno-unused-parameter
warning-1 += -Wmissing-declarations
warning-1 += -Wmissing-format-attribute
warning-1 += -Wmissing-prototypes
warning-1 += -Wold-style-definition
warning-1 += $(call cc-option, -Wmissing-include-dirs)

warning-2 := -Waggregate-return
warning-2 += -Wcast-align
warning-2 += -Wdisabled-optimization
warning-2 += -Wnested-externs
warning-2 += -Wshadow
warning-2 += $(call cc-option, -Wlogical-op)

warning-3 := -Wbad-function-cast
warning-3 += -Wcast-qual
warning-3 += -Wconversion
warning-3 += -Wpacked
warning-3 += -Wpadded
warning-3 += -Wpointer-arith
warning-3 += -Wredundant-decls
warning-3 += -Wswitch-default
warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
warning-3 += $(call cc-option, -Wvla)

warning := $(warning-$(KBUILD_ENABLE_EXTRA_GCC_CHECKS))

ifeq ("$(warning)","")
$(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
endif

KBUILD_CFLAGS += $(warning)
endif

include scripts/Makefile.lib
Expand Down

0 comments on commit 85dabc7

Please sign in to comment.