Date: Mon, 22 Jan 2001 09:30:43 -0600 From: "Jacques A. Vidrine" <n@nectar.com> To: Daniel Eischen <eischen@vigrid.com> Cc: arch@freebsd.org Subject: Re: Request For Review: libc/libc_r changes to allow -lc_r Message-ID: <20010122093043.B93103@hamlet.nectar.com> In-Reply-To: <Pine.SUN.3.91.1010120171614.8403A-100000@pcnet1.pcnet.com>; from eischen@vigrid.com on Sat, Jan 20, 2001 at 05:26:26PM -0500 References: <20010120153158.A88123@hamlet.nectar.com> <Pine.SUN.3.91.1010120171614.8403A-100000@pcnet1.pcnet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jan 20, 2001 at 05:26:26PM -0500, Daniel Eischen wrote: > Sorry, I don't think that's going to work, especially for > sigaction, flock, and kevent. These cannot be #define'd to > there underscore(_) equivalents because it would also redefine > struct sigaction, struct flock, and struct kevent. So there are a handful of special cases. > The tree has already been populated with lotsa _foo calls; this > just finishes the job. A handful of `_foo's don't bother me. Having hundreds of calls that must be _foo does bother me (I'm speaking of all the symbols that need to be hidden). > > By the way, should it be __thread_sys_foo and __foo? Two underscores? > > ISTR some rule about using a single leading underscore for file scope > > (e.g. macros) and two for global scope. > > I don't recall that, but anything for file scope that isn't a macro > can be static and not use the underscores. Macros are usually upper > case anyways. Excerpt from C99 7.1.3.1: -- All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use. -- All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces. Maybe I'm reading it wrong, but it looks to me like _foo should really only be used for macros (file scope), and symbols that the implementation needs to expose should start with _[A-Z_]. Bruce once made this comment when we were discussing hiding the err(3) symbols: Better with 2 prepended underscores (mainly for consistency). Maybe he has more to add. > > Finally, I hope this will lead us into introducing all non- Standard C > > (or at least non-POSIX) function identifiers in the same fashion, so > > as to clean up our namespace. For example, err(3). > > I think that's a good idea, and am willing to do the work if given > list of the functions that need to be changed. ISO/IEC 9899:1999 lists the reserved names. Any other library functions should ideally be hidden. Maybe I'll make a list of the reserved names and post'em. -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010122093043.B93103>