From owner-cvs-all@FreeBSD.ORG Tue Oct 28 21:11:35 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4061A16A4CE; Tue, 28 Oct 2003 21:11:35 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 27A4E43FBD; Tue, 28 Oct 2003 21:11:33 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id QAA05603; Wed, 29 Oct 2003 16:11:08 +1100 Date: Wed, 29 Oct 2003 16:11:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Peter Wemm In-Reply-To: <20031029004113.D517C2A8D5@canning.wemm.org> Message-ID: <20031029155812.M8125@gamplex.bde.org> References: <20031029004113.D517C2A8D5@canning.wemm.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: kientzle@acm.org Subject: Re: cvs commit: src/usr.bin/chat Makefile X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2003 05:11:35 -0000 On Tue, 28 Oct 2003, Peter Wemm wrote: > Tim Kientzle wrote: > > > On Sat, 25 Oct 2003, Peter Wemm wrote: > > >>peter 2003/10/25 21:49:58 PDT > > >> > > >> FreeBSD src repository > > >> > > >> Modified files: > > >> usr.bin/chat Makefile > > >> Log: > > >> The math function logf() probably isn't doing us much good for logging > > >> stuff. Add -fno-builtin-logf. > > > > Rather than commit ugly Makefile hacks like > > this, just rename the damned function and > > be done with it. > > Be my guest. Be sure to get your changes are sent back to the vendor, or > that the vendor has fixed it already. This is not what you asked for, but here is a quick fix for the main bugs in -Wshadow. It has not been sent to the vendor or built the world. It doesn't affect chat unless chat is compiled with a C90 compiler (so that doesn't declare logf()), since chat bogusly declares logf() as global. %%% Index: c-decl.c =================================================================== RCS file: /home/ncvs/src/contrib/gcc/c-decl.c,v retrieving revision 1.9 diff -u -2 -r1.9 c-decl.c --- c-decl.c 22 Aug 2003 03:14:37 -0000 1.9 +++ c-decl.c 29 Oct 2003 04:57:16 -0000 @@ -977,5 +977,7 @@ built-in definition is overridden, but optionally warn this was a bad choice of name. */ - if (warn_shadow) + /* XXX Actually only warn if the built-in is declared somewhere + other than in the compiler. */ + if (warn_shadow && DECL_SOURCE_LINE (olddecl) != 0) warning_with_decl (newdecl, "shadowing built-in function `%s'"); /* Discard the old built-in function. */ @@ -1647,5 +1649,8 @@ } else if (IDENTIFIER_GLOBAL_VALUE (name) != 0 - && IDENTIFIER_GLOBAL_VALUE (name) != error_mark_node) + && IDENTIFIER_GLOBAL_VALUE (name) != error_mark_node + /* XXX No shadow warnings for shadowing built-ins that are + not declared somewhere other than in the compiler. */ + && DECL_SOURCE_LINE (IDENTIFIER_GLOBAL_VALUE (name)) != 0) shadow_warning ("a global declaration", name, IDENTIFIER_GLOBAL_VALUE (name)); %%% Test program: %%% #ifdef DECLARE_MATH_FUNCTIONS #include #endif /* This shouldn't shadow log() unless math.h is included. */ static int log(double x) { return (x); } int main(void) { /* This shouldn't shadow logf() unless math.h is included. */ int logf; logf = 1; return (logf); } %%% Bruce