Microsoft KB Archive/84594

= FIX: F4998 Not Generated for Variable in CALL Statement =

Article ID: 84594

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.1
 * Microsoft FORTRAN Compiler 5.0
 * Microsoft FORTRAN Compiler 5.1
 * Microsoft FORTRAN PowerStation 1.0 Standard Edition
 * Microsoft Fortran PowerStation 1.0a for MS-DOS
 * Microsoft FORTRAN PowerStation 32

-



This article was previously published under Q84594



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 &quot;variable used but not defined&quot; 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 kbfix kbcompiler KB84594

-

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

© Microsoft Corporation. All rights reserved.