FIX: F2352 Missing, Array Name as Statement Function Argument

ID: Q23412

5.10 | 5.10 MS-DOS | OS/2 kbtool kbfixlist kbbuglist

The information in this article applies to:

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

Last Reviewed: April 30, 1998