diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2013-09-13 17:51:40 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2013-10-23 10:36:57 -0400 |
commit | 80970472179a45609c0b11b80619bc8c32b15f77 (patch) | |
tree | 0c24f524e44dcdf8c7abcdbb9edb515d07e923c4 /Makefile | |
parent | 272b98c6455f00884f0350f775c5342358ebb73f (diff) |
Makefile: enable -Werror=implicit-int and -Werror=strict-prototypes by default
The common error found in forward-ported/backported patches is missing
headers. One recent example (files and function names are mangled):
void foo(){}
EXPORT_SYMBOL(foo);
gave only warning
foo.c:12345678:5: warning: function declaration isn't a prototype [-Wstrict-prototypes]
void foo(){}
^
foo.c:12345679:5: warning: data definition has no type or storage class [enabled by default]
EXPORT_SYMBOL(foo);
foo.c:12345679:5: warning: type defaults to 'int' in declaration of 'EXORT_SYMBOL' [-Werror=implicit-int]
Now it's a fatal error. Tested on x86_64 allyesconfig.
[akpm@linux-foundation.org: fix typos in comments]
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -659,6 +659,12 @@ KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) | |||
659 | # conserve stack if available | 659 | # conserve stack if available |
660 | KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) | 660 | KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) |
661 | 661 | ||
662 | # disallow errors like 'EXPORT_GPL(foo);' with missing header | ||
663 | KBUILD_CFLAGS += $(call cc-option,-Werror=implicit-int) | ||
664 | |||
665 | # require functions to have arguments in prototypes, not empty 'int foo()' | ||
666 | KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes) | ||
667 | |||
662 | # use the deterministic mode of AR if available | 668 | # use the deterministic mode of AR if available |
663 | KBUILD_ARFLAGS := $(call ar-option,D) | 669 | KBUILD_ARFLAGS := $(call ar-option,D) |
664 | 670 | ||