From owner-freebsd-arch Sun Mar 16 5:52: 9 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 50A6037B401; Sun, 16 Mar 2003 05:52:07 -0800 (PST) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 98A5943F93; Sun, 16 Mar 2003 05:52:06 -0800 (PST) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 399EA5308; Sun, 16 Mar 2003 14:52:03 +0100 (CET) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: arch@freebsd.org Cc: Maxime Henrion Subject: Re: WARNS=6 changes From: des@ofug.org (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Sun, 16 Mar 2003 14:52:02 +0100 In-Reply-To: (des@ofug.org's message of "Sun, 16 Mar 2003 14:32:36 +0100") Message-ID: User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 References: <20030313192045.GG3819@elvis.mu.org> <20030316062315.GA75492@dragon.nuxi.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable des@ofug.org (Dag-Erling Sm=F8rgrav) writes: > Hmm, I think it should be a separate knob. We can merge it into WARNS > later, but for now, we should just remove -ansi / -pedantic from > WARNS, and add a CSTD knob which can be either c89 or c99. See the attached patch. DES --=20 Dag-Erling Smorgrav - des@ofug.org --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=cstd.diff Index: bsd.sys.mk =================================================================== RCS file: /home/ncvs/src/share/mk/bsd.sys.mk,v retrieving revision 1.11 diff -u -r1.11 bsd.sys.mk --- bsd.sys.mk 13 Nov 2002 13:49:29 -0000 1.11 +++ bsd.sys.mk 16 Mar 2003 13:39:28 -0000 @@ -9,6 +9,17 @@ # for GCC: http://gcc.gnu.org/onlinedocs/gcc-3.0.4/gcc_3.html#IDX143 .if !defined(NO_WARNS) +. if defined(CSTD) +. if ${CSTD} == "K&R" +CFLAGS += -traditional +. elsif ${CSTD} == "c89" || ${CSTD} == "c90" +CFLAGS += -std=iso9899:1990 +. elsif ${CSTD} == "c94" || ${CSTD} == "c95" +CFLAGS += -std=iso9899:199409 +. elsif ${CSTD} == "c99" +CFLAGS += -std=iso9899:1999 +. endif +. endif . if defined(WARNS) . if ${WARNS} > 0 . if !defined(NO_WERROR) @@ -19,17 +30,20 @@ CFLAGS += -Wall -Wno-format-y2k . endif . if ${WARNS} > 2 -CFLAGS += -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith +CFLAGS += -W -Wstrict-prototypes -Wmissing-prototypes \ + -Wpointer-arith . endif . if ${WARNS} > 3 -CFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align +CFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch \ + -Wshadow -Wcast-align . endif . if ${WARNS} > 4 CFLAGS += -Wuninitialized . endif # BDECFLAGS . if ${WARNS} > 5 -CFLAGS += -ansi -pedantic -Wbad-function-cast -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls +CFLAGS += -pedantic -Wbad-function-cast -Wchar-subscripts \ + -Winline -Wnested-externs -Wredundant-decls . endif . if ${WARNS} > 1 && ${WARNS} < 5 # XXX Delete -Wuninitialized by default for now -- the compiler doesn't @@ -43,7 +57,8 @@ . endif . if defined(WFORMAT) . if ${WFORMAT} > 0 -#CFLAGS += -Wformat-nonliteral -Wformat-security -Wno-format-extra-args +#CFLAGS += -Wformat-nonliteral -Wformat-security \ +# -Wno-format-extra-args CFLAGS += -Wformat=2 -Wno-format-extra-args . if !defined(NO_WERROR) CFLAGS += -Werror --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message