------- Comment #3 from burnus at gcc dot gnu dot org  2010-03-01 15:37 -------
I now check the standard.

a) Hollerith constants (not H... in FORMAT) are deleted in Fortran 77, but they
were allowed in Fortran 66. F77 "A.2 Conflicts with ANSI X3.9-1966" has:
"Hollerith constants and Hollerith data are not permitted in this standard.
ANSI X3.9-1966 permitted the use of Hollerith constants in DATA and CALL
statements"

b) They seemingly need to be space padded; F77 "C.4 Hollerith Constant" has:
"For an entity of type integer, real, or logical, the number of characters n in
the corresponding Hollerith constant must be less than or equal to g, where g
is the maximum number of characters that can be stored in a single numeric
storage unit at one time. If n is less than g, the entity is initially defined
with the n Hollerith characters extended on the right with g - n blank
characters.
Note that each Hollerith constant initially defines exactly one variable or
array element. Also note that g is processor dependent"

gfortran seemingly supports the common extension of allowing arrays (and not
just array elements) to be initialized by a single constant.

F66 has Holleriths in 4.2.6, 5.1.1.6 and some other places, though I could not
spot the padding part. (I have not tried very hard.)

c) The Hollerith constants should not be mixed up with the H edit descriptor,
which has only be deleted in Fortran 95 (cf. "B.1.5 H edit descriptor" in F95).

 * * *

> You folks think of the crazy stuff :)  I will check into this.

Well, that's the nice thing. With minimal modifications even Fortran IV
programs will run with today's compiler. Compare this with Python where you
need to modify/audit your code to go from Python 2 (released 2000) to 3
(released 2008).

If you look at the example on page 46 of "Fortran - Programmer's Reference
Manual" from 1956, you have no trouble except for the FREQUENCY statement
(estimate of likelihood that a certain branch is taken) - and also on p. 48 it
does not look to strange, though WRITE TAPE, END FILE and MORE PROGRAM do not
exist anymore. And contrary to the the H edit descriptor, Hollerith constants
wee not available; as there were no DATA nor subroutines that it not
surprising. (There were functions but they could not be written in Fortran.)

 * * *

See: http://gcc.gnu.org/wiki/GFortranStandards for the Fortran 77 and 66
standards - and the Fortran handbook of 1956.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43217

Reply via email to