From owner-freebsd-arch@FreeBSD.ORG Wed May 7 02:32:47 2003 Return-Path: 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 2E2AE37B401; Wed, 7 May 2003 02:32:47 -0700 (PDT) Received: from HAL9000.homeunix.com (12-233-57-131.client.attbi.com [12.233.57.131]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6BD7D43F75; Wed, 7 May 2003 02:32:46 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.5) with ESMTP id h479WedN015820; Wed, 7 May 2003 02:32:40 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.5/Submit) id h479WeXP015819; Wed, 7 May 2003 02:32:40 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Wed, 7 May 2003 02:32:40 -0700 From: David Schultz To: "Jacques A. Vidrine" , Harti Brandt , Terry Lambert , freebsd-arch@FreeBSD.ORG Message-ID: <20030507093240.GA15754@HAL9000.homeunix.com> Mail-Followup-To: "Jacques A. Vidrine" , Harti Brandt , Terry Lambert , freebsd-arch@FreeBSD.org References: <20030501182820.GA53641@madman.celabo.org> <20030505110601.H53365@beagle.fokus.fraunhofer.de> <20030506093754.B838@beagle.fokus.fraunhofer.de> <3EB7CC73.9C61C27E@mindspring.com> <20030506165850.Y601@beagle.fokus.fraunhofer.de> <20030506152605.GE77708@madman.celabo.org> <20030506175017.C631@beagle.fokus.fraunhofer.de> <20030506162352.GC78486@madman.celabo.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030506162352.GC78486@madman.celabo.org> Subject: Re: `Hiding' libc symbols X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2003 09:32:47 -0000 On Tue, May 06, 2003, Jacques A. Vidrine wrote: > On Tue, May 06, 2003 at 05:53:16PM +0200, Harti Brandt wrote: > > JAV>Or stated more agressively, the day the FreeBSD toolchain refuses > > JAV>to allow me to define my own version of strlcpy _for use by my > > JAV>application_ is the day I find another development platform. > > > > So if you 'hide' all the libc symbols you will to exactly that. > > Of course not. I can define strlcpy like so > > void > strlcpy(struct string *a, struct string *b) > { > if (a->size == 0) { > b->size = 0; > return; > } > /* really copy the string */ > } Hmm...but that program is broken. If someone overrides a symbol reserved by the C standard, he deserves whatever he gets. It is not unreasonable to expect applications to avoid using reserved symbols for thier own purposes. On the other hand, if someone who knows what he is doing wants to override malloc() or printf() or *any* other standard function for a specialized purpose, it is desirable that he be able to do that in a semi-portable way (i.e. without having to know about the underscores). Note that my definition of knowing what you're doing includes making sure that the new function has the same external API as the old one. For instance, I might override malloc() to maintain statistics for me, or printf() (not sprintf()!) to do some specialized formatting.