From owner-cvs-src@FreeBSD.ORG Tue Oct 28 03:28:34 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC11716A4CE; Tue, 28 Oct 2003 03:28:34 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37E0143FE9; Tue, 28 Oct 2003 03:28:32 -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 WAA15903; Tue, 28 Oct 2003 22:28:24 +1100 Date: Tue, 28 Oct 2003 22:28:24 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= In-Reply-To: Message-ID: <20031028222117.X4879@gamplex.bde.org> References: <200310260449.h9Q4nwm9016893@repoman.freebsd.org> <20031026171515.P17272@gamplex.bde.org> <20031027152156.Y21211@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: Peter Wemm Subject: Re: cvs commit: src/usr.bin/chat Makefile X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2003 11:28:34 -0000 On Tue, 28 Oct 2003, Dag-Erling [iso-8859-1] Sm=F8rgrav wrote: > Bruce Evans writes: > > On Sun, 26 Oct 2003, Dag-Erling [iso-8859-1] Sm=F8rgrav wrote: > > > In the meantime, now that we have a working fabsl(3), we can add > > > -fno-builtin to CFLAGS in bsd.sys.mk. > > That would just break the warning and pessimize anything that is optimi= zed > > by the builtins. > > The warnings are wrong more often than not... particularly the *lack* > of warning when you use a builtin function without including the > header that declares it. But that is fixed: %%% Script started on Tue Oct 28 22:20:44 2003 ttyp0:bde@besplex:/tmp> cat z.c int main(void) { =09return (strlen("123")); } ttyp0:bde@besplex:/tmp> cc -O -S -Wimplicit z.c z.c: In function `main': z.c:4: warning: implicit declaration of function `strlen' ttyp0:bde@besplex:/tmp> cat z.s =09.file=09"z.c" =09.text =09.p2align 2,,3 =2Eglobl main =09.type=09main, @function main: =09pushl=09%ebp =09movl=09%esp, %ebp =09subl=09$8, %esp =09andl=09$-16, %esp =09movl=09$3, %eax =09leave =09ret =09.size=09main, .-main =09.ident=09"GCC: (GNU) 3.3.1 [FreeBSD]" ttyp0:bde@besplex:/tmp> exit Script done on Tue Oct 28 22:20:58 2003 %%% Note that it uses the builtin to just return 3 after emitting the warning. Similarly for `return (log(3));`. gcc doesn't do the log() inline, at least on i386's with no options, but it knows to pass 3.0 and convert the return value to int. Bruce