FIX: F1001: omf_ms.c, Line 1093, Variable Used Then DeclaredLast reviewed: September 11, 1997Article ID: Q51608 |
4.10 5.00 5.10 | 4.10 5.00 5.10
MS-DOS | OS/2kbtool kbfixlist kbbuglist kberrmsg The information in this article applies to:
SYMPTOMSCompiling an application in OS/2 fails and a protection violation occurs. An attempt to compile the same application in MS-DOS fails and the compiler generates the appropriate message below. For FORTRAN version 5.1:
F1001 : Internal Compiler Error (compiler file '@(#)omf_ms.c:1.119',line 1093)For FORTRAN versions 4.1 and 5.0:
F1001 : Internal Compiler Error (compiler file '@(#)omf_ms.c:1.118',line 1093) CAUSEThe application contains an executable statement that refers to a variable that is used later as a formal parameter in an ENTRY statement but not as a formal argument in a SUBROUTINE statement. FORTRAN does not support this practice.
RESOLUTIONTo avoid this error, declare each variable used in an executable statement as a formal argument in a SUBROUTINE statement.
STATUSMicrosoft has confirmed this to be a problem in FORTRAN versions 4.1, 5.0, and 5.1. This problem was corrected in FORTRAN PowerStation, version 1.0.
MORE INFORMATIONFORTRAN does not support using a variable in an executable statement if it does not appear in a SUBROUTINE statement. The fourth paragraph on page 163 in the Microsoft FORTRAN "Reference" manual for versions 5.0 and 5.1 includes the following statement:
A formal argument cannot appear in an executable statement that occurs before the ENTRY statement containing the formal argument unless the formal argument also appears in a FUNCTION, SUBROUTINE, or ENTRY statement that precedes the executable statement.The next-to-last paragraph on page 208 of the Microsoft FORTRAN "Language Reference" manual for version 4.1 contains similar information. FORTRAN PowerStation correctly generates the error:
F2209: illegal as formal argumentThe following code example demonstrates this problem.
Sample Code #1C Compile options needed: None
A = 100.0 CALL SETPT (A) CALL FRSTC STOP END SUBROUTINE FRSTC WRITE (*, *) B ! b in an executable statement RETURN ENTRY SETPT (B) ! b as formal parameter (for first time) RETURN ENDIf the application declares "B" as a formal parameter for the FRSTC subroutine, the program compiles without any errors.
Sample Code #2
A = 100.0 CALL SETPT (A) CALL FRSTC (A) STOP END SUBROUTINE FRSTC (B) WRITE (*, *) B RETURN ENTRY SETPT (B) RETURN END |
Additional reference words: 4.10 5.00 5.10 buglist4.10 buglist5.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |