[PATCH] Fix environ.c on darwin (ping)
Peter O'Gorman
peter@pogma.com
Thu Dec 9 06:33:00 GMT 2004
Steven Bosscher wrote:
> On Thursday 28 October 2004 23:30, Steven Bosscher wrote:
>
>>On Wednesday 27 October 2004 16:47, Andrew Pinski wrote:
>>
>>>This is basically the patch from the PR for this (PR 17748) with
>>>an additional comment which says why this is needed.
>>>The problem is that even though darwin has a man page for environ,
>>>it does not really have the variable but does have a function,
>>>_NSGetEnviron, which does the same thing as the variable.
>>>
>>>OK? Built and tested on powerpc-darwin.
>>
>>Hmm I didn't know we are looking looking directly at enrivon.
>>Can't we use getenv()&friends from POSIX?
>
>
> Hmm I see...
>
> runtime/environ.c:643
> for (e = environ; *e; e++)
> {
> p = pattern_scan (*e, "GFORTRAN_NAME_", &n);
> if (p == NULL)
> continue;
> st_printf ("GFORTRAN_NAME_%d %s\n", n, p);
> }
>
> Ugh, how ugly.
>
> This only happens for GFORTRAN_NAME_xx and GFORTRAN_UNBUFFERED_xx.
>
> Perhaps we should reconsider how to implement this option. What
> about GFORTRAN_NAME=unitno1:nameprefix1,unitno2:nameprefix2, etc,
> and something similar for GFORTRAN_UNBUFFERED_xx.
>
> FWIW this option apparently is not even implemented, so whatever
> we do can't break things for people.
Could we do something about it? Either apply this patch as is and when a
decision is made on GFORTRAN_NAME_xx and GFORTRAN_UNBUFFERED_xx it can be
removed.
Thanks,
Peter
--
Peter O'Gorman - http://www.pogma.com
More information about the Fortran
mailing list