The information in this article applies to:
SYMPTOMSWhen Microsoft FORTRAN compiles an application that contains a variable initialized in a type declaration that is also listed in an EQUIVALENCE statement, and the EQUIVALENCE statement appears first in the source code file, one of the following errors occurs. In FORTRAN versions 4.0 and 4.0a: In FORTRAN versions 4.01 and 4.10: In version 5.0, when an application contains a variable that is initialized in a type declaration or a DATA statement, the variable is also listed in a COMMON or EQUIVALENCE statement, and the type declaration or DATA statement appears first in the source code file, the following error occurs:
RESOLUTION
In FORTRAN versions 4.x, modify the code such that variables that appear
in a COMMON or EQUIVALENCE statement are not initialized. Use an
assignment statement in the body of the code to give variables a value.
STATUSMicrosoft has confirmed this to be a problem in FORTRAN versions 4.0, 4.0a, 4.01, 4.1, and 5.0 for MS-DOS and versions 4.1 and 5.0 for OS/2. This problem was corrected in FORTRAN version 5.1. MORE INFORMATIONFORTRAN versions 4.x do not support initializing variables that appear in COMMON or EQUIVALENCE statements. When the compiler detects such an attempt, it is designed to produce the following error messages:
Often, the compiler correctly generates the first error message. However, instead of generating the second error, an internal compiler error occurs instead. In version 5.0, the compiler was extended to allow this extension to the ANSI standard by allowing a DATA statement to assign a value to a variable. Support for initializing a value in a type declaration was not added. The compiler is designed to generate one of the following error messages when the code uses a type declaration to initialize a variable that appears in a COMMON or EQUIVALENCE statement:
-or- However, instead of generating the correct error message above, an internal compiler error occurs. According to page 135 of the Microsoft FORTRAN "Reference" manual for version 5.0, the following example causes a compile-time error:
Page 165 of the "Reference" manual includes a similar warning about the
EQUIVALENCE statement with the following code
Compiling the following code with Microsoft FORTRAN versions 4.0, 4.0a,
4.01, or 4.1 generates an internal compiler error.
Sample Code #1
Compiling either of the following code examples with Microsoft FORTRAN
version 5.0 generates an internal compiler error.
Sample Code #2
Sample Code #3
The following code example demonstrates one method to avoid the compiler
error in Microsoft FORTRAN version 5.0.
Sample Code #4
Additional query words: 4.00 4.00a 4.01 4.10 5.00 buglist4.00a buglist4.01 buglist4.10 buglist5.00 fixlist5.10
Keywords : |
Last Reviewed: November 2, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |