From owner-freebsd-arch Mon Jul 9 4:15:34 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id F364537B401 for ; Mon, 9 Jul 2001 04:15:29 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id VAA12787; Mon, 9 Jul 2001 21:15:22 +1000 Date: Mon, 9 Jul 2001 21:13:17 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Dag-Erling Smorgrav Cc: arch@FreeBSD.ORG Subject: Re: -fno-builtin In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On 9 Jul 2001, Dag-Erling Smorgrav wrote: > arch@FreeBSD.ORG writes: > > No. We might as well as totally turn builtins off since the goal is to > > have the whole tree under WARNS=2. Since you want to change > > functionality, the burdon is on you to convince us why you want to do this > > -- which you have not. > > The alternatives - just to get it to build - are to turn off -Wshadow, > or rename every single local variable in the tree that shadows a > builtin (and believe me, there are *tons* of these). > > In addition, there's the issue of errors that -fno-builtin hides - > many of those have been fixed already, but I don't know how many > remain (or how many will be introduced in the future). I think gcc gets this backwards. I think it should warn about builtins shadowing local variables only if the relevant header is included, and it should warn about missing prototypes for builtins unless the relevarnt is included. Possible work-around: make -fno-builtin the default, and re-implement all of the builtin functions that you want using macros or inline functions. E.g.: --- #include static __inline size_t strlen(const char *s) { return (__builtin_strlen(s)); } --- Unfortunately, the inline function version doesn't work right, at least on i386's: __builtin_strlen("foo") gives code that loads the constant result 3, but the inline strlen("foo") gives code that scans the string. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message