delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/08/07/12:02:55

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" <eliz AT gnu DOT org>
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: <ufn7h0p3s00qq4vqmq3odgnt67i4hisdfn@4ax.com> (message from Brian
Inglis on Fri, 06 Aug 2004 19:57:39 GMT)
Subject: Re: Environment Variables
References: <cepqfs$jts AT odak26 DOT prod DOT google DOT com> <vY6Qc.33228$vX4 DOT 11673 AT cyclops DOT nntpserver DOT com> <41115A5F DOT 7DDC6318 AT yahoo DOT com> <bNtQc.58210$vX4 DOT 56203 AT cyclops DOT nntpserver DOT com> <41127AF9 DOT 26DEA37C AT yahoo DOT com> <4112BE04 DOT 3B151CA1 AT yahoo DOT com> <7494-Fri06Aug2004121205+0300-eliz AT gnu DOT org> <ufn7h0p3s00qq4vqmq3odgnt67i4hisdfn AT 4ax DOT com>
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

> From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT Invalid>
> 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: <libc/environ.h> (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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019