X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Sat, 07 Aug 2004 18:59:54 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-Id: <7137-Sat07Aug2004185953+0300-eliz@gnu.org> X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: (message from Brian Inglis on Fri, 06 Aug 2004 19:57:39 GMT) Subject: Re: Environment Variables References: <41115A5F DOT 7DDC6318 AT yahoo DOT com> <41127AF9 DOT 26DEA37C AT yahoo DOT com> <4112BE04 DOT 3B151CA1 AT yahoo DOT com> <7494-Fri06Aug2004121205+0300-eliz AT gnu DOT org> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: Brian Inglis > Newsgroups: comp.os.msdos.djgpp > Date: Fri, 06 Aug 2004 19:57:39 GMT > > FWIW below is a list of library symbols that pollute the user global > namespace in *ALL* C programs and are not mentioned in the libc > documentation. Thanks for posting this list. > ISTM that a reasonable first step would be to document the existence > of these symbols in the libc documentation Patches to the docs are most welcome. > and possibly add useful > public interfaces to some header file, perhaps only for the case of > environ, which seems to be the only symbol likely to be accessed by > user level code. Unfortunately, that's not easy to do; see below. > A useful place for at least defining environ so that it could at least > be found in a header file might be in .../include/libc/environ.h No, that's not good: (as well as all the other headers in the `libc' subdirectory) are internal libc headers. Applications should never use them. > between the ANSI and POSIX excludes [1], unless _POSIX_SOURCE has to > be defined to include it, in which case [2]: > > #ifndef __STRICT_ANSI__ > > extern char **environ; [1] > > #ifndef _POSIX_SOURCE > > extern char **environ; [2] Alas, the Posix standrad explicitly says that `environ' is not declared in any system header. So if we want to stop polluting the namespace of strictly ANSI programs with this symbol, we need to devise something more creative. Thanks anyway for your suggestions.