From owner-cvs-all Sun Nov 26 16:21:31 2000 Delivered-To: cvs-all@freebsd.org Received: from citusc17.usc.edu (citusc17.usc.edu [128.125.38.177]) by hub.freebsd.org (Postfix) with ESMTP id 61EBE37B479; Sun, 26 Nov 2000 16:21:26 -0800 (PST) Received: (from kris@localhost) by citusc17.usc.edu (8.11.1/8.11.1) id eAR0MMg41717; Sun, 26 Nov 2000 16:22:22 -0800 (PST) (envelope-from kris) Date: Sun, 26 Nov 2000 16:22:22 -0800 From: Kris Kennaway To: "David E. O'Brien" Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/contrib/gcc.295 c-common.c c-decl.c c-tree.h toplev.c src/contrib/gcc.295/cp decl2.c Message-ID: <20001126162222.B41584@citusc17.usc.edu> References: <200011262353.PAA90874@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="wzJLGUyc3ArbnUjN" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200011262353.PAA90874@freefall.freebsd.org>; from obrien@FreeBSD.org on Sun, Nov 26, 2000 at 03:53:24PM -0800 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --wzJLGUyc3ArbnUjN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 26, 2000 at 03:53:24PM -0800, David E. O'Brien wrote: > obrien 2000/11/26 15:53:24 PST >=20 > Modified files: > contrib/gcc.295 c-common.c c-decl.c c-tree.h toplev.c=20 > contrib/gcc.295/cp decl2.c=20 > Log: > Add "-Wnon-const-format" which checks for non-constant format strings f= or > auditing purposes. > =20 > I am reluctant to bring this into our native GCC tree due to maintenance > reasons... but since Kris already did the porting work and it won't be > pulling any files off the vendor branch..... but I will not port this > functionality forward to newer versions of GCC if it requires more than > 5 min of work, and if these changes do cleanly apply to GCC snapshots, > I will remove it the moment GCC changes underneath theses changes. > =20 > Submitted by: kris > Obtained from: NetBSD Thanks David. Anyone interested is encouraged to grab a chunk of http://www.freebsd.org/~kris/gcc-format-audit (let me know which bits you're claiming so there isn't any duplication of effort) and work through them. You should also be on the audit@FreeBSD.org mailing list where we like to bitch about this kind of thing :-) Library functions which take format string arguments should be documented, and internal functions within a program need to be checked to see whether any of the invocations use a non-constant format string. Some of the warnings can be squashed by explicitly declaring a constant format string to be const, etc. Be careful about source code which is included or compiled in another program in another part of the tree - for functions which don't have common names like panic() your favourite source code indexing tool like glimpse can show you other possible external uses. Kris --wzJLGUyc3ArbnUjN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjohqT4ACgkQWry0BWjoQKVpvQCeNvuGppw7FfGFMXTMUehwELh8 gq8AoMe89m2GpksmFAcN0XoMwr7JyXIA =383E -----END PGP SIGNATURE----- --wzJLGUyc3ArbnUjN-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message