summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.sys.mk
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2013-04-19 19:45:00 +0000
committered <ed@FreeBSD.org>2013-04-19 19:45:00 +0000
commit120125784a1ca698c656c6ef5e21e219df994f64 (patch)
tree1891dfdc2dd1f99e115fc2d96089a475729f0e87 /share/mk/bsd.sys.mk
parente342f91158ed3a8e688d9b01fd14d57ad91ea8b0 (diff)
downloadFreeBSD-src-120125784a1ca698c656c6ef5e21e219df994f64.zip
FreeBSD-src-120125784a1ca698c656c6ef5e21e219df994f64.tar.gz
Add the Clang specific -Wmissing-variable-declarations to WARNS=6.
This compiler flag enforces that that people either mark variables static or use an external declarations for the variable, similar to how -Wmissing-prototypes works for functions. Due to the fact that Yacc/Lex generate code that cannot trivially be changed to not warn because of this (lots of yy* variables), add a NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this specific compiler warning. Announced on: toolchain@
Diffstat (limited to 'share/mk/bsd.sys.mk')
-rw-r--r--share/mk/bsd.sys.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 1d8b49d..72dfa61 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -54,6 +54,10 @@ CWARNFLAGS+= -Wcast-align
.if ${WARNS} >= 6
CWARNFLAGS+= -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls\
-Wold-style-definition
+.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD) && \
+ !defined(NO_WMISSING_VARIABLE_DECLARATIONS)
+CWARNFLAGS+= -Wmissing-variable-declarations
+.endif
.endif # WARNS >= 6
.if ${WARNS} >= 2 && ${WARNS} <= 4
# XXX Delete -Wuninitialized by default for now -- the compiler doesn't
OpenPOWER on IntegriCloud