FIX: F4998 Not Generated for Variable in CALL Statement

ID: Q84594


The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, versions 5.0, 5.1
  • Microsoft FORTRAN for OS/2, versions 5.0, 5.1
  • Microsoft FORTRAN PowerStation for MS-DOS, versions 1.0, 1.0a
  • Microsoft Fortran Powerstation 32 for Windows NT, version 1.0


SYMPTOMS

When a variable is a part of an expression that is an actual argument in a CALL statement but is not otherwise defined, Microsoft FORTRAN does not generate the F4998 "variable used but not defined" warning message even though the compiler is designed to do so.


CAUSE

Normally, the compiler does not check actual arguments to verify that a value has been assigned to an argument. When a CALL statement uses an expression as its actual argument, the compiler should check all components of the expression to verify that the application assigned a value to each of them.


RESOLUTION

To ensure that this warning message occurs for each variable in an expression used in a CALL statement, modify the source code to assign each expression to a temporary variable and specify the temporary variable as the argument in the CALL statement.


STATUS

Microsoft has confirmed this to be a bug in the products listed above. This problem was corrected in FORTRAN PowerStation version 4.0.


MORE INFORMATION

The code example below demonstrates this problem. The F4998 warning does not occur for I even though no value was assigned to it.

Sample Code 1


C Compile options needed: None

       CALL X (I + 1)
       END 
In the code example below, the F4998 warning message occurs as expected.

Sample Code 2


C Compile options needed: None

       K = I + 1
       CALL X (K)  ! using temporary variable  in CALL statement
       END 

Additional query words: 5.00 5.10 1.00 1.00a

Keywords : kberrmsg kbCompiler kbFL32 kbFortranPS
Version : :1.0,1.0a,5.0,5.1
Platform : MS-DOS NT OS/2 WINDOWS
Issue type :


Last Reviewed: November 2, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.