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

Last reviewed: July 18, 1995
Article ID: Q51295
The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS and OS/2 versions 5.0, 5.1
  • Microsoft FORTRAN PowerStation for MS-DOS, versions 1.0 and 1.0a
  • Microsoft FORTRAN PowerStation 32 for Windows NT, version 1.0

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 reference words: 1.00 5.00 5.10
KBCategory: kbtool kberrmsg kbprb
KBSubcategory: FLIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 18, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.