FIX: $DECLARE Fails on Undeclared Argument-List Variables

Last reviewed: September 11, 1997
Article ID: Q31320
4.00 4.01 4.10 5.00 5.10 | 4.10 5.00 5.10
MS-DOS                   | OS/2
kbtool kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FORTRAN for MS-DOS, versions 4.0, 4.01, 4.1, 5.0, 5.1
  • Microsoft FORTRAN for OS/2, versions 4.1, 5.0, 5.1

SYMPTOMS

When an application uses the $DECLARE metacommand and a variable without a type appears in the argument list of a subroutine, the compiler does not produce a compile time warning.

RESOLUTION

Use the IMPLICIT NONE statement, to force the compiler to generate a warning message.

STATUS

Microsoft has confirmed this to be a problem in Microsoft FORTRAN versions 4.0, 4.01, 4.1, 5.0, and 5.1 for MS-DOS and versions 4.1, 5.0, and 5.1 for OS/2. This problem was corrected in FORTRAN PowerStation.

MORE INFORMATION

The following sample code demonstrates the problem. Even though the code uses the $DECLARE metacommand, the following code compiles without any warning messages.

With FORTRAN PowerStation, the following messages are generated when you compile the sample code with /4Ys:

   error F2026: metacommands are nonstandard
   warning F4313: A : not previously declared
   warning F4999: A : variable declared but not used

Sample Code

C Compiler options required: none

$DECLARE

      SUBROUTINE POOT(A)
      A=1.0
      RETURN
      END


Additional reference words: 4.00 4.01 4.10 5.00 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 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.