FWIW: a header defining environ would be in violation of POSIX unless
protected by _POSIX_C_SOURCE, since a POSIX compliant program would
result in a redundant definition warning, if you had your warnings
cranked up, and it is unspecified by ANSI/ISO C:
<
http://www.opengroup.org/onlinepubs/009695399/functions/environ.html>
The ANSI/ISO C standard, even in the current draft, totally ignores
the idea of iteration or setting or unsetting the environment (no
setenv(), putenv(), or unsetenv()), and specifically goes out of its
way to say that the behaviour of getenv() (S.7.20.4.4) is undefined if
the environment is modified by the program (section J.2, page 529 of
the current draft).
As I said in the other post, I think "extern char **environ" will
likely go away in a future version of POSIX, since it precludes an
implementation that would permit certain neat things from being
possible.
-- Terry
On Jan 4, 2006, at 9:43 AM, Dave Zarzycki wrote:
> Linux tends to export environ as a part of their headers, but for
> reasons not worth going into, it would be difficult to add to our
> headers without breaking source from compiling. If you look at the
> man page for environ, you'll see that developers are simply expected
> to do:
>
> extern char **environ;
>
>
> Cheers,
>
> davez
>
> On Jan 4, 2006, at 8:58 AM, Joe Koski wrote:
>
>> I have tried to build two different Fortran/C codes, plplot and
>> octave,
>> on my Mac G5 with OS X 10.3.9 with g95 Fortran in place of the
>> usual g77. In
>> both cases I'm using the developer's makefiles for a relatively
>> large build.
>> I get the same error with both codes after I export F77=g95 (or the
>> equivalent in the ./configure).
>>
>> All goes well until linking, then, with g95, both octave and plplot
>> get
>>
>> ld: Undefined symbols:
>> _environ
>>
>> As an aside, octave builds successfully on my Mac with both g77 and
>> gfortran
>> but not with g95. The g95 mail list reports that octave builds
>> without
>> problems with g95 on Linux. I haven't tried plplot with gfortran,
>> yet. Many
>> other g95 compiles and builds complete successfully without this
>> problem.
>>
>> According to the man pages, environ is the list of environment
>> variables. Do
>> I need to have an include in LDFLAGS, or somewhere to be sure I can
>> access
>> environ?
>>
>> Thanks.
>>
>> Joe
>>
>>
>>
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Unix-porting mailing list (
Unix-porting@list...)
>> Help/Unsubscribe/Update your Subscription:
>>
http://lists.apple.com/mailman/options/unix-porting/zarzycki%40apple.com
>>
>> This email sent to
zarzycki@appl...
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Unix-porting mailing list (
Unix-porting@list...)
> Help/Unsubscribe/Update your Subscription:
>
http://lists.apple.com/mailman/options/unix-porting/tlambert%40apple.com
>
> This email sent to
tlambert@appl...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list (
Unix-porting@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/subscriber%40opensubscriber.com
This email sent to
subscriber@open...
opensubscriber is not affiliated with the authors of this message nor responsible for its content.