This is the mail archive of the
mailing list for the glibc project.
Re: environ and -D_GNU_SOURCE
- To: Wolfgang Sourdeau <wolfgang at ultim dot net>
- Subject: Re: environ and -D_GNU_SOURCE
- From: Andreas Jaeger <aj at suse dot de>
- Date: 17 May 2000 18:32:45 +0200
- Cc: glibc-linux at ricardo dot ecn dot wfu dot edu
- References: <200005171548.LAA03493@linux.home>
- Reply-To: glibc-linux at ricardo dot ecn dot wfu dot edu
>>>>> Wolfgang Sourdeau writes:
> I need to access (char**) environ from one of my programs. But looking
> at unistd.h, I noticed I had to define _GNU_SOURCE at compile time to
> be able to reach it, although __environ would else be available.
> I don't understand why, since this variable is not specific to GNU.
__environ is an internal variable and shouldn't be used. It might be
that we remove it in the next release.
environ is not part of any standard AFAIK - and therefore you need
_GNU_SOURCE. If it would be, you would get it via one of the other
feature test macros. We can't allow it without any feature test
macro, since this would violate standards like ISO C or POSIX that not
only specify what has to be in a header - but also forbid anything
SuSE Labs email@example.com