Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Apr 2013 19:45:00 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r249657 - in head: bin/expr lib/csu sbin/gbde sbin/geom/class sbin/hastctl sbin/hastd sbin/md5 share/mk usr.bin/ar usr.bin/bc usr.bin/bzip2recover usr.bin/find usr.bin/indent usr.bin/m4...
Message-ID:  <201304191945.r3JJj0Cv081691@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Fri Apr 19 19:45:00 2013
New Revision: 249657
URL: http://svnweb.freebsd.org/changeset/base/249657

Log:
  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@

Modified:
  head/bin/expr/Makefile
  head/lib/csu/Makefile.inc
  head/sbin/gbde/Makefile
  head/sbin/geom/class/Makefile.inc
  head/sbin/hastctl/Makefile
  head/sbin/hastd/Makefile
  head/sbin/md5/Makefile
  head/share/mk/bsd.sys.mk
  head/usr.bin/ar/Makefile
  head/usr.bin/bc/Makefile
  head/usr.bin/bzip2recover/Makefile
  head/usr.bin/find/Makefile
  head/usr.bin/indent/Makefile
  head/usr.bin/m4/Makefile
  head/usr.bin/mklocale/Makefile
  head/usr.sbin/auditdistd/Makefile
  head/usr.sbin/bluetooth/bthidd/Makefile
  head/usr.sbin/bsnmpd/modules/Makefile.inc
  head/usr.sbin/config/Makefile
  head/usr.sbin/fifolog/lib/Makefile
  head/usr.sbin/jail/Makefile

Modified: head/bin/expr/Makefile
==============================================================================
--- head/bin/expr/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/bin/expr/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -4,4 +4,6 @@ PROG=	expr
 SRCS=	expr.y
 YFLAGS=
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 .include <bsd.prog.mk>

Modified: head/lib/csu/Makefile.inc
==============================================================================
--- head/lib/csu/Makefile.inc	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/lib/csu/Makefile.inc	Fri Apr 19 19:45:00 2013	(r249657)
@@ -4,4 +4,6 @@ SSP_CFLAGS=
 
 SED_FIX_NOTE = -i "" -e '/\.note\.tag/s/progbits/note/'
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 .include "../Makefile.inc"

Modified: head/sbin/gbde/Makefile
==============================================================================
--- head/sbin/gbde/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/sbin/gbde/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -10,6 +10,7 @@ SRCS+=	g_bde_lock.c
 # rijndael-fst.c does evil casting things which can results in warnings,
 # the test-vectors check out however, so it works right.
 NO_WCAST_ALIGN=
+NO_WMISSING_VARIABLE_DECLARATIONS=
 
 CFLAGS+= -I${.CURDIR}/../../sys
 .PATH:	${.CURDIR}/../../sys/geom/bde \

Modified: head/sbin/geom/class/Makefile.inc
==============================================================================
--- head/sbin/geom/class/Makefile.inc	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/sbin/geom/class/Makefile.inc	Fri Apr 19 19:45:00 2013	(r249657)
@@ -6,6 +6,8 @@ LINKS=	${BINDIR}/geom ${BINDIR}/g${GEOM_
 MAN=	g${GEOM_CLASS}.8
 SRCS+=	geom_${GEOM_CLASS}.c subr.c
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 CFLAGS+= -I${.CURDIR}/../..
 
 .include "../Makefile.inc"

Modified: head/sbin/hastctl/Makefile
==============================================================================
--- head/sbin/hastctl/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/sbin/hastctl/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -21,6 +21,7 @@ MAN=	hastctl.8
 
 NO_WFORMAT=
 NO_WCAST_ALIGN=
+NO_WMISSING_VARIABLE_DECLARATIONS=
 CFLAGS+=-I${.CURDIR}/../hastd
 CFLAGS+=-DHAVE_CAPSICUM
 CFLAGS+=-DINET

Modified: head/sbin/hastd/Makefile
==============================================================================
--- head/sbin/hastd/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/sbin/hastd/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -21,6 +21,7 @@ MAN=	hastd.8 hast.conf.5
 
 NO_WFORMAT=
 NO_WCAST_ALIGN=
+NO_WMISSING_VARIABLE_DECLARATIONS=
 CFLAGS+=-I${.CURDIR}
 CFLAGS+=-DHAVE_CAPSICUM
 CFLAGS+=-DPROTO_TCP_DEFAULT_PORT=8457

Modified: head/sbin/md5/Makefile
==============================================================================
--- head/sbin/md5/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/sbin/md5/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -13,6 +13,7 @@ MLINKS=	md5.1 rmd160.1 \
 	md5.1 sha256.1 \
 	md5.1 sha512.1
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
 WFORMAT?=	1
 
 DPADD=	${LIBMD}

Modified: head/share/mk/bsd.sys.mk
==============================================================================
--- head/share/mk/bsd.sys.mk	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/share/mk/bsd.sys.mk	Fri Apr 19 19:45:00 2013	(r249657)
@@ -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

Modified: head/usr.bin/ar/Makefile
==============================================================================
--- head/usr.bin/ar/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.bin/ar/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -8,6 +8,8 @@ SRCS=	ar.c acplex.l acpyacc.y read.c uti
 DPADD=	${LIBARCHIVE} ${LIBELF} ${LIBZ}
 LDADD=	-larchive -lelf -lz
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 CFLAGS+=-I. -I${.CURDIR}
 
 .if ${MK_SHARED_TOOLCHAIN} == "no"

Modified: head/usr.bin/bc/Makefile
==============================================================================
--- head/usr.bin/bc/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.bin/bc/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -8,6 +8,8 @@ CFLAGS+= -I. -I${.CURDIR}
 DPADD=	${LIBEDIT} ${LIBTERMCAP}
 LDADD=	-ledit -ltermcap
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 FILES+=	bc.library
 FILESDIR=${SHAREDIR}/misc
 

Modified: head/usr.bin/bzip2recover/Makefile
==============================================================================
--- head/usr.bin/bzip2recover/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.bin/bzip2recover/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -6,4 +6,6 @@ BZ2DIR=	${.CURDIR}/../../contrib/bzip2
 PROG=	bzip2recover
 NO_MAN=
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 .include <bsd.prog.mk>

Modified: head/usr.bin/find/Makefile
==============================================================================
--- head/usr.bin/find/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.bin/find/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -6,4 +6,6 @@ SRCS=	find.c function.c ls.c main.c misc
 	getdate.y
 YFLAGS=
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 .include <bsd.prog.mk>

Modified: head/usr.bin/indent/Makefile
==============================================================================
--- head/usr.bin/indent/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.bin/indent/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -1,6 +1,9 @@
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
+# $FreeBSD$
 
 PROG=	indent
 SRCS=	indent.c io.c lexi.c parse.c pr_comment.c args.c
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 .include <bsd.prog.mk>

Modified: head/usr.bin/m4/Makefile
==============================================================================
--- head/usr.bin/m4/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.bin/m4/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -8,8 +8,8 @@ PROG=	m4
 CFLAGS+=-DEXTENDED -I${.CURDIR} -I${.CURDIR}/lib
 DPADD=	${LIBY} ${LIBL} ${LIBM}
 LDADD=	-ly -ll -lm
-# clang needs 1 while with gcc we can use 2
-#WARNS=	1
+
+NO_WMISSING_VARIABLE_DECLARATIONS=
 
 SRCS=	eval.c expr.c look.c main.c misc.c gnum4.c trace.c parser.y tokenizer.l
 .PATH: ${.CURDIR}/lib

Modified: head/usr.bin/mklocale/Makefile
==============================================================================
--- head/usr.bin/mklocale/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.bin/mklocale/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -5,4 +5,6 @@ PROG=	mklocale
 SRCS=	yacc.y lex.l y.tab.h
 CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../../lib/libc/locale
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 .include <bsd.prog.mk>

Modified: head/usr.sbin/auditdistd/Makefile
==============================================================================
--- head/usr.sbin/auditdistd/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.sbin/auditdistd/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -10,6 +10,7 @@ OPENBSMDIR=${.CURDIR}/../../contrib/open
 CFLAGS+=-I${OPENBSMDIR} -I${OPENBSMDIR}/bin/auditdistd
 
 NO_WFORMAT=
+NO_WMISSING_VARIABLE_DECLARATIONS=
 
 PROG=	auditdistd
 SRCS=	auditdistd.c

Modified: head/usr.sbin/bluetooth/bthidd/Makefile
==============================================================================
--- head/usr.sbin/bluetooth/bthidd/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.sbin/bluetooth/bthidd/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -13,4 +13,6 @@ DEBUG_FLAGS=	-g
 DPADD=          ${LIBBLUETOOTH} ${LIBUSBHID}
 LDADD=		-lbluetooth -lusbhid
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 .include <bsd.prog.mk>

Modified: head/usr.sbin/bsnmpd/modules/Makefile.inc
==============================================================================
--- head/usr.sbin/bsnmpd/modules/Makefile.inc	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.sbin/bsnmpd/modules/Makefile.inc	Fri Apr 19 19:45:00 2013	(r249657)
@@ -6,4 +6,6 @@ MANFILTER=	sed -e 's%@MODPATH@%${LIBDIR}
 		    -e 's%@DEFPATH@%${DEFSDIR}/%g'		\
 		    -e 's%@MIBSPATH@%${BMIBSDIR}/%g'
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 .include "../Makefile.inc"

Modified: head/usr.sbin/config/Makefile
==============================================================================
--- head/usr.sbin/config/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.sbin/config/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -11,6 +11,8 @@ kernconf.c: kernconf.tmpl
 
 CFLAGS+= -I. -I${.CURDIR}
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 DPADD=	${LIBL} ${LIBSBUF}
 LDADD=	-ll -lsbuf
 

Modified: head/usr.sbin/fifolog/lib/Makefile
==============================================================================
--- head/usr.sbin/fifolog/lib/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.sbin/fifolog/lib/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -8,4 +8,6 @@ SRCS+=	getdate.y
 
 CFLAGS+= -I${.CURDIR}
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 .include <bsd.lib.mk>

Modified: head/usr.sbin/jail/Makefile
==============================================================================
--- head/usr.sbin/jail/Makefile	Fri Apr 19 19:38:39 2013	(r249656)
+++ head/usr.sbin/jail/Makefile	Fri Apr 19 19:45:00 2013	(r249657)
@@ -9,6 +9,8 @@ SRCS=	jail.c command.c config.c state.c 
 DPADD=	${LIBJAIL} ${LIBKVM} ${LIBUTIL} ${LIBL}
 LDADD=	-ljail -lkvm -lutil -ll
 
+NO_WMISSING_VARIABLE_DECLARATIONS=
+
 YFLAGS+=-v
 CFLAGS+=-I. -I${.CURDIR}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304191945.r3JJj0Cv081691>