Microsoft KB Archive/23412

= FIX: F2352 Missing, Array Name as Statement Function Argument =

Article ID: 23412

Article Last Modified on 10/23/2003

-

APPLIES TO


 * Microsoft FORTRAN Compiler 5.1
 * Microsoft FORTRAN Compiler 5.1

-



This article was previously published under Q23412



SYMPTOMS
In Microsoft FORTRAN versions prior to version 5.1, an attempt to compile an application that uses an array as a dummy argument in a statement function fails and the compiler generates the following message:

error F2352: formal argument not local variable

However, this message does not appear when FORTRAN version 5.1 compiles the application.



CAUSE
The error message is correct; the program is syntactically incorrect. According to page 15-4 of the ANSI X3.9-1978 FORTRAN specification, an application can reuse the names of the dummy arguments in a statement function as a variable name or as a COMMON block name, but not as an array name (see lines 39-44).

Microsoft FORTRAN version 5.1 does not generate the F2352 error message under these conditions, even when compiler command line specifies the -4Ys compiler option switch or the code contains the $STRICT metacommand.



STATUS
Microsoft has confirmed this to be a problem in FORTRAN version 5.1 for MS-DOS and OS/2. This problem was corrected in FORTRAN PowerStation version 1.0.



MORE INFORMATION
Microsoft FORTRAN versions prior to version 5.1 correctly generate the F2352 error message compiling the following application.

Microsoft FORTRAN PowerStation generates the F2352 error if you compile the sample code with /4Ys.

Sample Code
COMMON /XX/ W(10) COMMON Y(5) MYFUNC(Y, W) = Y * W     END

Additional query words: 5.10

Keywords: kbfix KB23412

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.