From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 19:45:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 08CC48D5; Fri, 19 Apr 2013 19:45:05 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E03001ACF; Fri, 19 Apr 2013 19:45:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JJj4xd081850; Fri, 19 Apr 2013 19:45:04 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JJj0Cv081691; Fri, 19 Apr 2013 19:45:00 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201304191945.r3JJj0Cv081691@svn.freebsd.org> From: Ed Schouten Date: Fri, 19 Apr 2013 19:45:00 +0000 (UTC) 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... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 19:45:05 -0000 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 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 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 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 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 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 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 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}