PRB: Huge CHARACTER Array Causes Incorrect Results
PSS ID Number: Q10645
Article last modified on 02-10-1993

3.20

MS-DOS


----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft FORTRAN for MS-DOS, version 3.2
----------------------------------------------------------------------

Summary:

SYMPTOMS
   An application compiled with Microsoft FORTRAN version 3.2 that
   contains a huge CHARACTER array halts the machine or produces
   incorrect results.

CAUSE
   The compiler generates an incorrect address for array elements at
   or beyond the 64K segment boundary.

RESOLUTION
   Do not use arrays of characters larger than 64K with FORTRAN
   version 3.2.

STATUS
   Microsoft confirmed this to be a problem in FORTRAN version 3.2 for
   MS-DOS. This problem was corrected in FORTRAN version 3.3 for
   MS-DOS.

More Information:

The following code example demonstrates this problem when it is
compiled with FORTRAN version 3.2.

Sample Code
-----------

C Compile options needed: None

      PARAMETER (N = 65538)
      CHARACTER ARR(N)

      DO 10 I = 1, N
        ARR(I) = 'A'
10    CONTINUE

      I = 1024 * 64
      WRITE(*, *) ARR(I)

      END

Additional reference words: 3.20

=============================================================================

Copyright Microsoft Corporation 1993.
