FIX: F2352 Missing, Array Name as Statement Function Argument

Last reviewed: September 10, 1997
Article ID: Q23412
5.10 | 5.10 MS-DOS | OS/2 kbtool kbfixlist kbbuglist

The information in this article applies to:

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

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 reference words: 5.10
KBCategory: kbtool kbfixlist kbbuglist
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 10, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.