FIX: F4998 Not Generated for Variable in CALL StatementLast reviewed: September 16, 1997Article ID: Q84594 |
5.00 5.10 1.00 1.00a | 5.00 5.10 | 1.00
MS-DOS | OS/2 | WINDOWS NTFL32Iss kbfixlist kberrmsg The information in this article applies to:
SYMPTOMSWhen 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.
CAUSENormally, 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.
RESOLUTIONTo 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.
STATUSMicrosoft has confirmed this to be a bug in the products listed above. This problem was corrected in FORTRAN PowerStation version 4.0.
MORE INFORMATIONThe code example below demonstrates this problem. The F4998 warning does not occur for I even though no value was assigned to it.
Sample Code 1C Compile options needed: None
CALL X (I + 1) ENDIn the code example below, the F4998 warning message occurs as expected.
Sample Code 2C Compile options needed: None
K = I + 1 CALL X (K) ! using temporary variable in CALL statement END |
Additional reference words: 5.00 5.10 1.00 1.00a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |