home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!ggawboy
- From: ggawboy@magnus.acs.ohio-state.edu (Galen F Gawboy)
- Subject: Re: function name as an argument
- Message-ID: <1992Dec16.013934.27917@magnus.acs.ohio-state.edu>
- Sender: news@magnus.acs.ohio-state.edu
- Nntp-Posting-Host: bottom.magnus.acs.ohio-state.edu
- Organization: The Ohio State University
- References: <ADK.92Dec12114449@ds2.sun13.SCRI.FSU.EDU> <1992Dec14.193634.5231@newshost.lanl.gov> <1gj95eINNqgo@gap.caltech.edu>
- Date: Wed, 16 Dec 1992 01:39:34 GMT
- Lines: 48
-
- In article <1gj95eINNqgo@gap.caltech.edu> shepard@sampson.ccsf.caltech.edu (Ron Shepard) writes:
- >I believe that the following is standard f77. Note that the character
- >function is declared as (*) in the main program, and is declared, and
- >called, with different *(CONSTANT) values from the two subroutines.
- >
- >It is apparently because of the requirement of *(CONSTANT) declaration
- >in the referencing subprogram that this can be done legally without
- >recourse to runtime memory allocation.
- >
- > [ deleted an esoteric but interesting subroutine].
- >
- >Upon execution on a couple of machines, I get:
- >
- >cvar=1234567890xxxxxxxxxxxxxxxxxxxx
- >cvar=12345678901234567890xxxxxxxxxx
- >
- >which is what I thought I should get according to the previous discussion
- >in this thread.
- >
- >Are there any machines that give different results?
- >
- >-Ron Shepard
- >shepard@tcg.anl.gov
-
- Well I tried this code on 4 handy machines. I did not put any effort
- into porting the codes since I operated under the assumption that "standard
- fortran" should make it through "default" compiler options.
-
- Sparc station
- cvar=1234567890xxxxxxxxxxxxxxxxxxxx
- cvar=12345678901234567890xxxxxxxxxx
-
- The code did not make through the compiler on the following machines.
-
- CRAY YMP.
-
- DEC station running ultrix.
-
- IBM rs6000 running aix.
-
- I guess that this just reiterates that assuming that "standard fortran" will
- compile under default compiler options is always a dangerous assumption :-).
-
- -Regards
-
- Galen F. Gawboy
-
- gawboy@sodium.mps.ohio-state.edu
-