Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 May 2003 10:36:41 -0500
From:      "Jacques A. Vidrine" <nectar@FreeBSD.org>
To:        Harti Brandt <brandt@fokus.fraunhofer.de>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: Re: `Hiding' libc symbols
Message-ID:  <20030506153641.GI77708@madman.celabo.org>
In-Reply-To: <20030506112711.K838@beagle.fokus.fraunhofer.de>
References:  <20030501182820.GA53641@madman.celabo.org> <XFMail.20030501144502.jhb@FreeBSD.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>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030506153641.GI77708>