FIX: Incorrect Results Writing Array of Structure Variables

Last reviewed: September 11, 1997
Article ID: Q68528
5.00 | 5.00 MS-DOS | OS/2 kbtool kbfixlist kbbuglist kberrmsg kbcode

The information in this article applies to:

  • Microsoft FORTRAN for MS-DOS and OS/2, versions 5.0

SYMPTOMS

An application produces incorrect results when it writes an array of structure variables. An attempt to compile the application with the patched High-Capacity FORTRAN version 5.0 compiler (F1L.EXE) and link for OS/2 fails and Microsoft LINK generates the following message:

   Error L2002: fixup overflow at 13 in segment _DATA

The application runs correctly when you compile it with the unpatched versions of the Microsoft FORTRAN version 5.0 F1.EXE or F1L.EXE file.

CAUSE

The application was compiled with the patched version of the F1.EXE file or with the patched F1L.EXE file.

RESOLUTION

To address this problem, perform one of the following two steps:

  • Modify the source code to change the structure variable to a one-element array.
  • Modify the source code to assign the structure variable to a temporary variable and specify the temporary variable in the output statement.

STATUS

Microsoft has confirmed this to be a problem in the patched version of FORTRAN version 5.0 for MS-DOS and OS/2. This problem was corrected in FORTRAN version 5.1 for MS-DOS and OS/2.

MORE INFORMATION

Among other things, the F1.EXE patch corrects the following error:

   F1001: Internal Compiler Error
          compiler file omf_ms.c:1.118, line 1093

This error often occurs when an application performs an I/O operation on the elements of a structure after passing that structure to a subprogram.

The High-Capacity Compiler, F1L.EXE, is an alternate form of the first compiler pass. Use the High-Capacity Compiler when an attempt to compile an application with the regular compiler fails and generates the following message:

   F1901: program too large for memory

The following code example demonstrates this problem.

Sample Code #1

C Compile options needed: None

      STRUCTURE / REC /
       CHARACTER*12 NUM
      END STRUCTURE
      RECORD / REC / ALLREC(3)
      ALLREC(1).NUM = 'ONE'
      ALLREC(2).NUM = 'TWO'
      ALLREC(3).NUM = 'THREE'
10 FORMAT(' ', A12)
      DO 20 I = 1, 3
       WRITE(*, 10) ALLREC(I).NUM   ! Outputs "ONE" for each iteration
20 CONTINUE
      END

In the following code example, NUM is a one element array. The program produces the expected output.

Sample Code #2

C Compile options needed: None

      STRUCTURE / REC /
       CHARACTER*12 NUM(1)
      END STRUCTURE
      RECORD / REC / ALLREC(3)
      ALLREC(1).NUM = 'ONE'
      ALLREC(2).NUM = 'TWO'
      ALLREC(3).NUM = 'THREE'
10 FORMAT(' ', A12)
      DO 20 I = 1, 3
       WRITE(*, 10) ALLREC(I).NUM(1)   ! Outputs "ONE"
                                       !         "TWO"
                                       !         "THREE"
20 CONTINUE
      END


Additional reference words: 5.00 buglist5.00 fixlist5.10
KBCategory: kbtool kbfixlist kbbuglist kberrmssg kbcode
KBSubCategory: FLIss
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.