PRB: F4998: "Variable Used But Not Defined" in Intrinsic Funcs

ID: Q51295


The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, 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
  • Microsoft FORTRAN for OS/2, versions 5.0, 5.1


SYMPTOMS

When the FORTRAN compiler processes a source code file, it produces the following warning message:

F4998: variable used but not defined


CAUSE

The file contains a variable that is used as an argument in an intrinsic function before it is assigned a value.


RESOLUTION

This behavior is expected and serves as a warning.


MORE INFORMATION

The following list of intrinsic functions are confirmed to produce this warning message:

abs, exp, ior, loc, locfar, locnear,
log, max, mod, not, sin, sqrt, tan
The following code example demonstrates this warning message.

Sample Code #1


C Compile options needed: None

      REAL TMP
      WRITE (*, *) SIN(TMP)
      END 
The following code example eliminates this warning message by assigning a value to TMP before using it as an argument to an intrinsic function.

Sample Code #2


C Compile options needed: None

      REAL TMP
      TMP = 1
      WRITE (*, *) SIN(TMP)
      END 

Additional query words: 1.00 5.00 5.10

Keywords :
Version : :1.0,1.0a,5.0,5.1
Platform :
Issue type :


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