From owner-freebsd-arch@FreeBSD.ORG Tue May 6 08:36:41 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 5259237B401 for ; Tue, 6 May 2003 08:36:41 -0700 (PDT) Received: from gw.nectar.cc (gw.nectar.cc [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 73EDD43FBF for ; Tue, 6 May 2003 08:36:40 -0700 (PDT) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.nectar.cc (Postfix) with ESMTP id C42F166; Tue, 6 May 2003 10:36:39 -0500 (CDT) Received: by madman.celabo.org (Postfix, from userid 1001) id 27B7378C66; Tue, 6 May 2003 10:36:41 -0500 (CDT) Date: Tue, 6 May 2003 10:36:41 -0500 From: "Jacques A. Vidrine" To: Harti Brandt Message-ID: <20030506153641.GI77708@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Harti Brandt , Peter Jeremy , freebsd-arch@freebsd.org References: <20030501182820.GA53641@madman.celabo.org> <20030505110601.H53365@beagle.fokus.fraunhofer.de> <20030505175426.GA19352@madman.celabo.org> <20030506093754.B838@beagle.fokus.fraunhofer.de> <20030506092519.GA3158@cirb503493.alcatel.com.au> <20030506112711.K838@beagle.fokus.fraunhofer.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030506112711.K838@beagle.fokus.fraunhofer.de> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.3i-ja.1 cc: freebsd-arch@freebsd.org Subject: Re: 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: Tue, 06 May 2003 15:36:41 -0000 On Tue, May 06, 2003 at 11:43:13AM +0200, Harti Brandt wrote: > To say it otherwise: I think hiding names that are not in Posix/Ansi is a > good thing, because we must assume, that applications have functions with > the same names doing entirely different things. Hiding names that are not > standardized functions, but are in the standard or implementation > namespace is probably a good thing to do too. Hiding functions that are in > the standards is a bad thing. If applications use these names, we should > assume that the function does at least what the standard requires. If not > the application is broken and must be fixed. Otherwise we will break an > unknown number of applications. We _already_ hide many POSIX/ANSI names, without any ill effects or portability consequences. Please understand the issues before posting. Since I set $SUBJECT, I will re-state what I meant by `hiding' libc symbols. I was specifically referring to the namespace.h/weak symbol method which we have been using for over 100 functions in libc for years. That is: Renaming the internal implementation of `foo' to `_foo', and creating a weak symbol alias with the original name (`foo'). Within libc, use the `_foo' name when the semantics must be known (e.g. when the behavior must not be overridden by an application accidently, i.e. almost always). Macros in `namespace.h' help the compiler with prototypes etc. Cheers, -- Jacques Vidrine . NTT/Verio SME . FreeBSD UNIX . Heimdal nectar@celabo.org . jvidrine@verio.net . nectar@freebsd.org . nectar@kth.se