PRB: F2347 or F2201 Error When Function Is Not TypedLast reviewed: December 9, 1995Article ID: Q123689 |
The information in this article applies to:
SYMPTOMSWhen compiling, you receive the following error message:
F2347: <function name> : missing TypeYou may also receive the following error message:
F2201: <function name> : Type redefinedError F2347 is not documented in the Microsoft FORTRAN Professional Development System version 5.1.
CAUSEThe return type of a FORTRAN function must be declared in the calling scope. If the type is not defined, implicit typing will occur. If you use the IMPLICIT NONE statement, you will receive the F2347 error. If you do not use the IMPLICIT NONE statement and the implicit typing does not agree with the formal declaration of the function, you will receive the F2201 error.
RESOLUTIONProvide explicit typing for FORTRAN functions, as in the code sample below.
STATUSThis behavior is by design.
MORE INFORMATIONCompiling the sample code that follows will generate the F2201 error. Removing the comment on the IMPLICIT NONE line will cause it to generate the F2347 error in addition to the F2201 error. Removing the comment on the INTEGER func line will resolve both errors. NOTE: Under Fortran PowerStation 4.0 the following error message is displayed when compiling the Sample Code as given:
error FOR2205: wrong data type for reference to FUNCTION FUNC from procedure TESTThe following error message is displayed if you uncomment the IMPLICIT NONE line:
error FOR2290: implicit type for FUNC Sample Code to Demonstrate Behavior
/* Compile options needed: none */ PROGRAM testC IMPLICIT NONE
REAL a, bC INTEGER func
a = 2.0 b = 3.0 b = func(a, b) WRITE(*, *) func(a, b) END INTEGER FUNCTION func(a, b) REAL a, b PRINT*, a, b func = int(a) RETURN END |
Additional reference words: 5.10 1.00 1.00a 4.00 docerr errmsg err msg
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |