diff options
author | Andrew Morton <akpm@osdl.org> | 2003-09-23 09:43:09 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-09-23 09:43:09 -0700 |
commit | 535231e8252eea14abf4f14d28f6c1c03f5e0f02 (patch) | |
tree | 90733f1214d8589325ebe6af15f2e6ab8a0a6894 /Makefile | |
parent | 6921bb18cadc10029e2ab7812a5843e3251b4b6a (diff) | |
download | history-535231e8252eea14abf4f14d28f6c1c03f5e0f02.tar.gz |
[PATCH] add -Wdeclaration-after-statement
From: John Levon <levon@movementarian.org>
Not that many people are going to be using GCC 3.4 currently, but it
might help a bit to prevent compilation bugs like that just witnessed
in procfs.
(And it consolidates the check_gcc implementation nicely)
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile index b44445c1bd9b0..a32ebe122aefa 100644 --- a/Makefile +++ b/Makefile @@ -231,7 +231,9 @@ ifneq ($(findstring s,$(MAKEFLAGS)),) quiet=silent_ endif -export quiet Q KBUILD_VERBOSE +check_gcc = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) + +export quiet Q KBUILD_VERBOSE check_gcc # Look for make include files relative to root of kernel src MAKEFLAGS += --include-dir=$(srctree) @@ -430,6 +432,9 @@ ifdef CONFIG_DEBUG_INFO CFLAGS += -g endif +# warn about C99 declaration after statement +CFLAGS += $(call check_gcc,-Wdeclaration-after-statement,) + # # INSTALL_PATH specifies where to place the updated kernel and system map # images. Uncomment if you want to place them anywhere other than root. |