Hollerith mini-survey

Harald Anlauf anlauf@gmx.de
Fri Feb 1 20:04:00 GMT 2019


While working on PR89077, I hit the following issue:

What shall we do with the following program?

program hollerith
  implicit none
  character(len=*), parameter :: s = 9Hhollerith
  print *, "#", s, "#", len (s), len ("hollerith")
end

gfortran-7/8/9 print:

 #hollerith   #          12           9

sunf95:

 #hollerith# 9 9

ifort rejects the code with

hollerith.f90(3): error #6957: This is an illegal data type value for
this parameter.   [9Hhollerith]
  character(len=*), parameter :: s = 9Hhollerith
-------------------------------------^

etc.

NAG, even with -dusty, says:

Extension: hollerith.f90, line 3: Hollerith constant
           detected at =@9Hhollerith
Error: hollerith.f90, line 3: Invalid context for Hollerith constant
(not data-stmt-value or actual argument in CALL)


Thanks for your opinions.

Harald



More information about the Fortran mailing list