Microsoft KB Archive/31320

= FIX: $DECLARE Fails on Undeclared Argument-List Variables =

Article ID: 31320

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft FORTRAN Compiler 4.0
 * Microsoft FORTRAN Compiler 4.01
 * Microsoft FORTRAN Compiler 4.1
 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.1
 * Microsoft FORTRAN Compiler 4.1
 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.1

-



This article was previously published under Q31320



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 query words: 4.00 4.01 4.10 5.00 5.10

Keywords: kbfix KB31320

-

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

© Microsoft Corporation. All rights reserved.