home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / fortran / 4742 < prev    next >
Encoding:
Text File  |  1992-12-15  |  2.0 KB  |  61 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!ggawboy
  3. From: ggawboy@magnus.acs.ohio-state.edu (Galen F Gawboy)
  4. Subject: Re: function name as an argument
  5. Message-ID: <1992Dec16.013934.27917@magnus.acs.ohio-state.edu>
  6. Sender: news@magnus.acs.ohio-state.edu
  7. Nntp-Posting-Host: bottom.magnus.acs.ohio-state.edu
  8. Organization: The Ohio State University
  9. References: <ADK.92Dec12114449@ds2.sun13.SCRI.FSU.EDU> <1992Dec14.193634.5231@newshost.lanl.gov> <1gj95eINNqgo@gap.caltech.edu>
  10. Date: Wed, 16 Dec 1992 01:39:34 GMT
  11. Lines: 48
  12.  
  13. In article <1gj95eINNqgo@gap.caltech.edu> shepard@sampson.ccsf.caltech.edu (Ron Shepard) writes:
  14. >I believe that the following is standard f77.  Note that the character
  15. >function is declared as (*) in the main program, and is declared, and
  16. >called, with different *(CONSTANT) values from the two subroutines.
  17. >
  18. >It is apparently because of the requirement of *(CONSTANT) declaration
  19. >in the referencing subprogram that this can be done legally without
  20. >recourse to runtime memory allocation.
  21. >
  22. > [ deleted an esoteric but interesting subroutine].
  23. >
  24. >Upon execution on a couple of machines, I get:
  25. >
  26. >cvar=1234567890xxxxxxxxxxxxxxxxxxxx
  27. >cvar=12345678901234567890xxxxxxxxxx
  28. >
  29. >which is what I thought I should get according to the previous discussion
  30. >in this thread.  
  31. >
  32. >Are there any machines that give different results?
  33. >
  34. >-Ron Shepard
  35. >shepard@tcg.anl.gov
  36.  
  37.     Well I tried this code on 4 handy machines. I did not put any effort
  38. into porting the codes since I operated under the assumption that "standard
  39. fortran" should make it through "default" compiler options.
  40.  
  41.    Sparc station 
  42.  cvar=1234567890xxxxxxxxxxxxxxxxxxxx
  43.  cvar=12345678901234567890xxxxxxxxxx
  44.  
  45.    The code did not make through the compiler on the following machines.
  46.  
  47.   CRAY YMP.
  48.  
  49.   DEC station running ultrix.
  50.  
  51.   IBM rs6000 running aix.
  52.  
  53.   I guess that this just reiterates that assuming that "standard fortran" will
  54. compile under default compiler options is always a dangerous assumption :-).
  55.  
  56. -Regards
  57.  
  58. Galen F. Gawboy
  59.  
  60. gawboy@sodium.mps.ohio-state.edu
  61.