Path: utzoo!attcan!uunet!husc6!rutgers!rochester!cornell!uw-beaver!teknowledge-vaxc!sri-unix!garth!smryan From: smryan@garth.UUCP (Steven Ryan) Newsgroups: comp.lang.fortran Subject: Re: fortran problem Message-ID: <719@garth.UUCP> Date: 12 Jun 88 22:00:37 GMT References: <8806111222.AA06982@jade.berkeley.edu> Reply-To: smryan@garth.UUCP (Steven Ryan) Organization: INTERGRAPH (APD) -- Palo Alto, CA Lines: 17 This is a long standing feature of Fortran. All parameters are passed by reference, so the address of the constant 1 is passed. The subroutine does not know this is constant--it is considerred the programmer's responsibilty. In some systems the constant is in a readonly page so that attempts to store into it cause an access violation. In some systems the io is translated into calls with the unit being passed by value (hidden protocols need not be conforming). In some systems constants used in expressions are handled by load immediate instructions so that each use of a constant is distinct. In other systems all uses of a constant map into the same memory location. Make it simple--not simplistic. sm ryan