[Info-vax] GCC for VMS, was: Re: fortran compiler roadmap?

glen herrmannsfeldt gah at ugcs.caltech.edu
Tue Apr 23 15:22:55 EDT 2013


Bob Koehler <koehler at eisner.nospam.encompasserve.org> wrote:
> In article <kl4ag3$29k$1 at speranza.aioe.org>, glen herrmannsfeldt <gah at ugcs.caltech.edu> writes:
 
>> It seems to have taken a special fixup in the VMS linker to make it work.
 
>   For passing CHARACTER to CHARACTER, no fix up is needed.  Lots of
>   Fortran-77 compilers only support that.  To implement the
>   Fortran-77 standard the compiler needs to pass both the size and
>   location of CHARACTER arguments.

Yes. 
 
>   But DEC supported passing character constants to integer, real, ...
>   variables, as we had always done in Fortran-IV.  That took a linker
>   fixup as in the calling routine the compiler would generate pass by
>   descriptor, but in the receiving routine it would be expecting pass
>   by reference.

I think you pretty much have to do that to support Fortran 77, which
should remain back compatible. Well, I suppose strictly only for 
Hollerith constants, but for compilers that supported them, 
apostrophe delimited constants were usual.
 
>   Different Fortran compilers have different ways of passing CHARACTER
>   variable length between routines, 

I figured this out about 10 years ago in a discussion on
comp.lang.fortran.

I knew that I had done it in VAX/VMS so many years before, but hadn't
thought at the time why it should or should not work.

More usual for Fortran compilers is to pass extra arguments at the
end of the argument list with the lengths, most likely by value.
Passing a CHARACTER constant (or variable) to a routine with an INTEGER
(or REAL or REAL*8, etc.) dummy argument just works. It ignores the
length argument, as usual for Fortran-IV. 

But VAX/VMS wanted to keep a consistent calling convention across
languages, and that meant passing CHARACTER by descriptor.
So, the fixup was needed if the callee wasn't expecting a
descriptor to be passed.


> but the RSX just didn't pass it. 
>   So existing RSX code that passed character constants to integer, ...
>   would keep running, but new code could not take advantage of the
>   passed length wihtout explicitly passing it.

-- glen



More information about the Info-vax mailing list