FIX: F1001 '@(#)ctypes.c:1.11', Holleriths, Line 467 (77482)



The information in this article applies to:

  • Microsoft FORTRAN Compiler for MS-DOS 4.0
  • Microsoft FORTRAN Compiler for MS-DOS 4.01
  • Microsoft FORTRAN Compiler for MS-DOS 4.1
  • Microsoft FORTRAN Compiler for MS-DOS 5.0
  • Microsoft FORTRAN Compiler for MS-DOS 5.1
  • Microsoft FORTRAN compiler for OS/2 4.1
  • Microsoft FORTRAN compiler for OS/2 5.0
  • Microsoft FORTRAN compiler for OS/2 5.1

This article was previously published under Q77482

SYMPTOMS

A FORTRAN program that appends a Hollerith constant consisting of five or more characters to a string may cause the compiler to generate an internal compiler error.

FORTRAN 5.1 under OS/2 and DOS:

fatal error F1001: Internal Compiler Error
(compiler file '@(#)ctypes.c:1.12', line 467)
FORTRAN 5.0 under OS/2 and DOS:
fatal error F1001: Internal Compiler Error
(compiler file '@(#)ctypes.c:1.11', line 467)
FORTRAN 4.1 under OS/2, and FORTRAN 4.1 and 4.01 under DOS:
fatal error F1001: Internal Compiler Error
(compiler file '@(#)ctypes.c:1.89', line 447)
FORTRAN 4.0 and 4.0a under DOS:
fatal error F1001: Internal Compiler Error
(compiler file '@(#)ctypes.c:1.80', line 445)

RESOLUTION

The Hollerith descriptor is mainly intended to be used within a FORMAT specifier. However, it should be able to be used in any context where character constants can be used.

To avoid this internal compiler error, add the Hollerith constant to the FORMAT statement instead of the character variable assignment.

Sample code #2 below illustrates this solution.

STATUS

Microsoft has confirmed this to be a problem in Microsoft FORTRAN versions 4.0, 4.01, 4.1, 5.0, and 5.1. This problem was corrected in FORTRAN PowerStation, version 1.0.

MORE INFORMATION

Compiling the following code produces an internal compiler error:

Sample Code #1

c Compile options needed: none

      WRITE (*, '(17H FORTRAN Compiler)') ! This is OK
      PRINT *, 'MS ' // 4HFort            ! This works fine
      PRINT *, 'MS ' // 5HFortr           ! F1001 Generated here
      END
				
The same problem happens if you increase the number of characters on the Hollerith constant.

A possible solution to this problem is to append the string and Hollerith constant in a FORMAT specifier. An alternative is to define the whole string inside the FORMAT and then write it out.

The following code illustrates these solutions:

Sample Code #2

        CHARACTER*4 String
        String = ' MS '

 100    FORMAT ( A4 , 10HC Compiler)    ! appending the string
c                                         in FORMAT specifier
 200    FORMAT (' MS ' 16HFortran Compiler)  !  defining entire string
c                                               inside the FORMAT
        PRINT 100, String
        PRINT 200
        END
				

Modification Type:MajorLast Reviewed:12/1/2003
Keywords:KB77482