[Info-vax] Text processing examples with Fortran requested
Michael Kraemer
m.kraemer at gsi.de
Mon Nov 16 17:20:26 EST 2009
In article <hdq5rb$gj6$3 at naig.caltech.edu>, glen herrmannsfeldt <gah at ugcs.caltech.edu> writes:
> Michael Kraemer <M.Kraemer at gsi.de> wrote:
> > Arne Vajh?j schrieb:
>
> >> And besides Fortran 77 is not that bad. CHARACTER is fine. Fortran 66
> >> would be painful.
>
> > F77 can be almost as painful for text stuff because
> > IIRC the standard does not provide for dynamically allocated
> > character strings.
>
> F77 doesn't provide for anything dynamically allocated. The form
> of expressions allowed for the CHARACTER data type is carefully
> designed to avoid the requirement of temporaries of unknown (at
> compile time) size.
Not quite. Constructs like
SUBROUTINE xxx( cc )
CHARACTER cc*(*)
print *, '...' // cc
caused subtle differences in implementation to show up (in 1991/92 or so).
Strictly speaking this would require dynamically allocated
temporaries because the length of the print argument is not
known at compile time.
The VAX compiler accepted the statement and pushed the temporary
on the stack.
The IBM compilers (MVS and AIX) issued a warning but used a
a temporary of fixed length, to be specified at compile time
(usually 32K, more than enough).
The Ultrix compiler rejected the "print", and forced a separate
user generated temporary.
More information about the Info-vax
mailing list