FIX: F1001: omf_ms.c:1.118; Equivalence with Structure Element

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

The information in this article applies to:

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

SYMPTOMS

Using Microsoft FORTRAN 5.0 (under MS-DOS) to compile a program that uses an element of a structure in a READ or WRITE statement after that structure is used in an EQUIVALENCE statement, can result in the following error:

   fatal error F1001: Internal Compiler Error
            (compiler file '@(#)omf_ms.c:1.118', line 1093)

When compiling under OS/2, a protection violation is generated by the third pass of the compiler.

CAUSE

The errors do not occur if the element of the structure is assigned to a temporary variable, and then this temporary variable is used in the READ or WRITE.

RESOLUTION/STATUS

An application note titled "FORTRAN 5.0 F1.EXE and F1L.EXE Structure Patch" is available to correct these errors. To obtain this application note, call Microsoft Product Support Services.

This file has been removed from the Software Library but can be requested by calling Microsoft Product Support Services. Microsoft has confirmed this to be a problem in FORTRAN version 5.0. This problem was corrected in FORTRAN version 5.1.

MORE INFORMATION

Sample Code #1

c The following program illustrates the problem:

      structure /a/
      character*1 x
      end structure

      record /a/ test
      character*1 word
      equivalence (word,test)
      word = 'a'
      write(*,*) test.x
      end

Sample Code #2

c Assigning the structure element to a temporary variable, as shown c below, and then using the temporary variable in the WRITE statement, c does not generate the errors.

      structure /a/
      character*1 x
      end structure

      record /a/ test
      character*1 word, tmp
      equivalence (word,test)
      word = 'a'
      tmp = test.x
      write(*,*) tmp
      end

If the /Zi compiler option is used to compile the program above, a protection violation will result when compiling under OS/2. The compiler will hang when run under MS-DOS. For more information, query on the following:

   /Zi and EQUIVALENCEing and RECORD and variables and hangs and machine


Additional reference words: 5.00 5.10 hf0225
KBCategory: kbtool kbfixlist kbbuglist kberrmsg kbappnote
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.