This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]