Intel® Fortran Compiler 17.0 Developer Guide and Reference

Understanding Errors During the Build Process

The Intel® Fortran Compiler identifies syntax errors and violations of language rules in the source program.

Compiler Diagnostic Messages

These messages describe diagnostics that are reported during the processing of the source file. Compiler diagnostic messages usually provide enough information for you to determine the cause of an error and correct it. These messages generally have the following format:

filename(linenum): severity #error number: message

Diagnostic

Meaning

filename

Indicates the name of the source file currently being processed.

linenum

Indicates the source line where the compiler detects the condition.

severity

Indicates the severity of the diagnostic message: Warning, Error, or Fatal error.

message

Describes the problem.

Error Message Example

echar.for(7): error #6321: An unterminated block exits.
       DO I=1,5
-------^

The pointer (---^) indicates the place on the source program line where the error was found, in this case where an END DO statement was omitted.

To view the passes as they execute on the command line, specify the watch option.

Note

You can perform compile-time procedure interface checking between routines with no explicit interfaces present. To do this, generate a module containing the interface for each compiled routine using the gen-interfaces option and check implicit interfaces using the warn[:]interfaces option.

Controlling Compiler Diagnostic Warning and Error Messages

You can use a number of compiler options to control the diagnostic messages issued by the compiler. For example, compiler option WB turns compile time bounds errors into warnings. To control compiler diagnostic messages (such as warning messages), use the warn option. This option controls warnings issued by the compiler and supports a wide range of keywords. Some of these are as follows:

For more information, see the warn compiler option.

You can also control the display of diagnostic information with variations of the [Q]diag compiler option. This compiler option accepts numerous arguments and values, allowing you wide control over displayed diagnostic messages and reports.

Some of the most common variations include the following:

Linux* and OS X*

Windows*

Description

-diag-enable =list

/Qdiag-enable:list

Enables a diagnostic message or a group of messages

-diag-disable =list

/Qdiag-disable:list

Disables a diagnostic message or a group of messages

-diag-warning =list

/Qdiag-warning:list

Tells the compiler to change diagnostics to warnings

-diag-error =list

/Qdiag-error:list

Tells the compiler to change diagnostics to errors

-diag-remark =list

/Qdiag-remark:list

Tells the compiler to change diagnostics to remarks (comments)

The list items can be specific diagnostic IDs, one of the keywords warn, remark, or error, or a keyword specifying a certain group (par, vec, driver, cpu-dispatch). For more information, see [Q]diag.

Additionally, you can use the following related options:

Linux* and OS X*

Windows*

Description

-diag-dump

/Qdiag-dump

Tells the compiler to print all enabled diagnostic messages and stop compilation.

-diag-file[=file]

/Qdiag-file[:file]

Causes the results of diagnostic analysis to be output to a file.

-diag-file-append[=file]

/Qdiag-file-append[:file]

Causes the results of diagnostic analysis to be appended to a file.

-diag-error-limit=n

/Qdiag-error-limit:n

Specifies the maximum number of errors allowed before compilation stops.

Linker Diagnostic Errors

If the linker detects any errors while linking object modules, it displays messages about their cause and severity. If any errors occur, the linker does not produce an executable file. Linker messages are descriptive, and you do not normally need additional information to determine the specific error.

To view the libraries being passed to the linker on the command line, specify the watch option.

Error Severity Levels

Comment Messages

These messages indicate valid but inadvisable use of the language being compiled. The compiler displays comments by default. You can suppress comment messages with the warn[:]nousage option.

Comment messages do not terminate translation or linking, they do not interfere with any output files either. Some examples of the comment messages are:

Null CASE construct
The use of a non-integer DO loop variable or expression
Terminating a DO loop with a statement other than CONTINUE or ENDDO

Warning Messages

These messages report valid but questionable use of the language being compiled. The compiler displays warnings by default. You can suppress warning messages by using the nowarn option. Warnings do not stop translation or linking. Warnings do not interfere with any output files. Some representative warning messages are:

constant truncated - precision too great
non-blank characters beyond column 72 ignored
Hollerith size exceeds that required by the context

Error Messages

These messages report syntactic or semantic misuse of Fortran. Errors suppress object code for the file containing the error and prevent linking, but they do not stop the compiler from scanning for any other errors. Some typical examples of error messages are:

line exceeds 132 characters
unbalanced parenthesis
incomplete string

Fatal Errors

Fatal messages indicate environmental problems. Fatal error conditions stop translation, assembly, and linking. If a fatal error ends compilation, the compiler displays a termination message on standard error output. Some representative fatal error messages are:

Disk is full, no space to write object file
Too many segments, object format cannot support this many segments

Using the Command Line

If you are using the command line, messages are written to the standard error output file. When using the command line:

Using the Visual Studio IDE (Windows*)

If you are using the Microsoft* Visual Studio* integrated development environment (IDE), compiler and linker errors are displayed in the Build pane of the Output window. To display the Output window, choose View > Other Windows > Output. You can also use the Task List window (View > Other Windows > Task List) to view display links to problems encountered during the build process. Click these tasks to jump to code that caused build problems. You can also check the Build log for more information.

To quickly locate the source line causing the error, follow these steps:

  1. Double-click the error message text in the Build pane of the Output window.

    - or -

  2. Press F8. The editor window appears with a marker in the left margin that identifies the line causing the error. You can continue to press F8 to scroll through additional errors.

After you have corrected any compiler errors reported during the previous build, choose Build project name from the Build menu. The build engine recompiles only those files that have changed, or which refer to changed include or module files. If all files in your project compile without errors, the build engine links the object files and libraries to create your program or library.

You can force the build engine to recompile all source files in the project by selecting Rebuild project name from the Build menu. This is useful to verify that all of your source code is clean, especially if you are using a makefile, or if you use a new set of compiler options for all of the files in your project.

When using the IDE:

See Also