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

glen herrmannsfeldt gah at ugcs.caltech.edu
Wed Apr 24 16:27:02 EDT 2013


Ken Fairfield <ken.fairfield at gmail.com> wrote:
> On Wednesday, April 24, 2013 11:23:21 AM UTC-7, glen herrmannsfeldt wrote:
> [...]
>> OK, I have never thought about this one before. Does Fortran 77 allow
>> Hollerith constants as actual arguments to CHARACTER dummy arguments?
 
> No.  You probably know that already from discussions over
> in c.l.f.  That VAX Fortran allowed it was/is an extension
> that allowed old programs to work under the new compiler.

I mostly never used Hollerith constants. The IBM OS/360 
compilers allowed apostrophed constants in the places where
Hollerith constants were allowed. 

In standard Fortran 66, I believe that they are allowed only
in DATA statements and subprogram actual arguments. 
 
> But as Bob said in another follow-up, Hollerith was already
> gone as of the F77 standard.
 
> Also note that in the port of the Fortran compiler to Alpha,
> this backward compatibility (with ancient source code) was
> lost.  You "can't do that" on an Alpha (or Itanium).
 
>> Otherwise, the DEC Fortran IV compilers allowed apostrophed constants
>> for so long that I think VAX compilers would have to support them, 
>> even if the standard didn't require it.
 
> I'm not entirely sure what you mean by "apostrophed constants".

Constants like 'XYZ' instead of 3HXYZ.

> That *is* the way you write a character constant, right?  If you
> mean assigning that character constant to a numerical variable
> (all that was available pre-F77), that is simply non-standard.
> VAX Fortran may have allowed it as an extension, but...

In Fortran 66, you can:

      CALL SUB(4HABCD)

and 

      SUBROUTINE SUB(I)
      WRITE(6,1) I
1     FORMAT(1X,A4)
      RETURN
      END

but many compilers allowed

      CALL SUB('ABCD')

But yes, many DEC compilers allowed assignment of character or
Hollerith constants in assignment statements as an extension.

      I='ABCD'
      J=4HEFGH

I usually avoided that, and just used DATA statements.

-- glen



More information about the Info-vax mailing list