This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
getenv implementation?
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: fortran at gcc dot gnu dot org
- Date: Sun, 29 Aug 2004 15:41:26 -0700
- Subject: getenv implementation?
Gang,
Now that the bessel and error functions and get{gpu}id
have been committedi, I was going to turn my attention to
G77's getcwd function and subroutine. I started to look
for something similar and noticed.
2004-08-06 Janne Blomqvist <jblomqvi@cc.hut.fi>
* intrinsic.c (add_subroutines): Add getenv and
get_environment_variable. (add_sym_5s): New function.
* intrinsic.h (gfc_resolve_get_environment_variable): Add
prototype.
* iresolve.c (gfc_resolve_get_environment_variable): New
function.
I have no idea what getenv in gfortran should do. "grep -i getenv"
leads to
kargl[213] grep -i getenv *
ChangeLog: * intrinsic.c (add_subroutines): Add getenv and
intrinsic.c: add_sym_2s ("getenv", 0, 1, BT_UNKNOWN, 0,
which corresponds to this block of code.
add_sym_2s ("getenv", 0, 1, BT_UNKNOWN, 0,
NULL, NULL, NULL,
name, BT_CHARACTER, dc, 0,
val, BT_CHARACTER, dc, 0);
There is no gfc_check_getenv nor gfc_resolve_getenv function.
How the heck is this suppose to work, particularly considering
kargl[207] f77 -o aa aa.f <--- g77
kargl[208] ./aa
name = DISPLAY
value = :0.0
kargl[209] gfc -o aa aa.f <--- gfortran
kargl[210] ./aa
name = DISPLAY
value = ?????
kargl[211] cat aa.f
program aa
character*70 name, value
name = 'DISPLAY'
call getenv(name,value)
print*, 'name = ', name
print*, 'value = ', value
end
--
Steve