Silverfrost Forums

Welcome to our forums

Compiler chokes on Hollerith strings in Format specification

18 Feb 2018 2:02 #21452

I hesitated before reporting the following bug (who uses Hollerith strings in Format these days?). FTN95 is not only capable of handling old style Fortran source, but even provides the /convert compiler option to modernise such source code.

Consider the following test program, which captures the issue. The actual code that triggered the bug is www.netlib.org/opt/varpro .

      PROGRAM TESTING                                                   34567890
      WRITE(*,100)                                                      0002
  100 FORMAT (95H  WARNING -- EXPECTED ERROR OF OBSERVATIONS IS NOT ZERO0003
     +.  COVARIANCE MATRIX MAY BE MEANINGLESS. /)                       0004
      END                                                               0005

FTN95 8.10 says:

0003)   100 FORMAT (95H  WARNING -- EXPECTED ERROR OF OBSERVATIONS IS NOT ZERO0003
0004)      +.  COVARIANCE MATRIX MAY BE MEANINGLESS. /)                       0004
*** Unknown edit descriptor '.', or missing comma

If, however, I use /convert, rename the output file to have a '.f' suffix and compile that, the compiler gives no error messages.

18 Feb 2018 5:47 #21453

The answer to 'who uses Hollerith strings today' is 'everyone who uses or tests old code' although if it was the more precise phrase '... in new code', then perhaps it is 'almost no-one'.

I've never seen this error when developing old code of my own from the dim and distant past with Holleriths, so perhaps it is a 'regression' undiscovered as no-one before you has used a recent version of FTN95 on such old code.

Eddie

19 Feb 2018 7:54 #21454

Many thanks for the feedback.

This issue was raised quite recently with the result that v8.20 includes a 'fix' which provides the compilation error 'Continuation of Hollerith strings is not supported'.

Eddie's remark about it possibly being a regression turns out to be (for me, unexpectedly) correct so a complete fix may not be too far away. v4.90 handles this code correctly. When I looked at this previously I couldn't see a way to fix it without major effort.

19 Feb 2018 5:42 #21458

Thanks, Paul.

FTN77 4.03 handles such Format statements correctly.

20 Feb 2018 3:46 #21471

This issue has been fixed so that FTN95 can now handle continued Hollerith strings.

Please login to reply.