Compiler Diagnostic Messages and Error Conditions

The Visual Fortran compiler identifies syntax errors and violations of language rules in the source program. If the compiler finds any errors, it writes messages to the standard error output file and any listing file. If you enter the DF command interactively, the messages are displayed.

Compiler messages have the following format:

  filename(n) : severity: message-text
          [text-in-error]
  --------^

The pointer (---^) indicates the exact place on the source program line where the error was found. The following error message shows the format and message text in a listing file when an END DO statement was omitted:

  echar.for(7): Severe: Unclosed DO loop or IF block
          DO I=1,5
  --------^

Diagnostic messages usually provide enough information for you to determine the cause of an error and correct it.

When using the command line, make sure that the appropriate environment variables have been set by executing the DFVARS.BAT file. These environment variables are preset if you use the Fortran Command Prompt window in the Compaq Visual Fortran program folder (see "Using the Command-Line Interface" in Compaq Visual Fortran Installing and Getting Started). For example, this BAT file sets the environment variables for the include directory paths.

For errors related to INCLUDE and module (USE statement) file use, see /[no]include.

For a list of environment variables used by the DF command during compilation, see Environment Variables Used with the DF Command.

To control compiler diagnostic messages (such as warning messages), see /[no]warn.

To view the passes as they execute on the DF command line, specify /watch:cmd or /watch:all.