IBM Books

User's Guide


Understanding XL Fortran Error Messages

Most information about potential or actual problems comes through messages from the compiler or application program. These messages are written to the standard error output stream.

Error Severity

Compilation errors can have the following severity levels, which are displayed as part of some error messages:

U
An unrecoverable error. Compilation failed because of an internal compiler error.

S
A severe error. Compilation failed due to one of the following:

E
An error that the compiler can correct. The program should run correctly.

W
Warning message. It does not signify an error, but may indicate some unexpected condition.

L
Warning message that was generated by one of the compiler options that check for conformance to various language levels. It may indicate a language feature that you should avoid if you are concerned about portability.

I
Informational message. It does not indicate any error, just something that you should be aware of to avoid unexpected behavior.

Notes:

  1. The message levels S and U indicate a compilation failure.
  2. The message levels I, L, W, and E indicate that compilation was successful.

By default, the compiler stops without producing output files if it encounters a severe error (severity S). You can make the compiler stop for less severe errors by specifying a different severity with the -qhalt option. For example, with -qhalt=e, the compiler stops if it encounters any errors of severity E or higher severity. This technique can reduce the amount of compilation time that is needed to check the syntactic and semantic validity of a program. You can limit low-severity messages without stopping the compiler by using the -qflag option. If you simply want to prevent specific messages from going to the output stream, see -qsuppress Option.

An easy way to choose options that reflect your goals is to run the xxlf command. This presents a point-and-click interface to different categories of compiler options.

Figure 39. Message and Listing Window of the xxlf Application

REQTEXT

Compiler Return Code

The compiler return codes and their respective meanings are as follows:

0
The compiler did not encounter any errors severe enough to make it stop processing a compilation unit.
1
The compiler encountered an error of severity E or halt_severity (whichever is lower). Depending on the level of halt_severity, the compiler might have continued processing the compilation units with errors.
40
An option error.
41
A configuration file error.
250
An out-of-memory error. The compiler cannot allocate any more memory for its use.
251
A signal received error. An unrecoverable error or interrupt signal is received.
252
A file-not-found error.
253
An input/output error. Cannot read or write files.
254
A fork error. Cannot create a new process.
255
An error while executing a process.

The Run-Time Return Code

If an XLF-compiled program ends abnormally, the return code to the operating system is 1.
Note:This is a change from XL Fortran Version 2, which used a value of 232 in this case.

If the program ends normally, the return code is 0 (by default) or MOD(digit_string,256) if the program ends because of a STOP digit_string statement.

Understanding XL Fortran Messages

In addition to the diagnostic message issued, the source line and a pointer to the position in the source line at which the error was detected are printed or displayed, if you specify the -qsource compiler option. If -qnosource is in effect, the file name, the line number, and the column position of the error are displayed with the message.

The format of an XL Fortran diagnostic message is:

>>-15--cc-----nnn-- --+-------------------------+---message_text-->
                      '-(--severity_letter--) --'
 
>--------------------------------------------------------------><
 

where:

15
Indicates an XL Fortran message.

cc
Is the component number, as follows:

00
Indicates a code generation or optimization message.

01
Indicates an XL Fortran common message.

11-20
Indicates a Fortran-specific message.

24
Indicates a VAST-2 preprocessor message.

25
Indicates a run-time message from an XL Fortran application program.

26
Indicates a KAP preprocessor message.

85
Indicates a loop-transformation message.

86
Indicates an interprocedural analysis (IPA) message.

nnn
Is the message number.

severity_letter
Indicates how serious the problem is, as described in the preceding section.

'message text'
Is the text describing the error.

Limiting the Number of Compile-Time Messages

If the compiler issues many low-severity (I or W) messages concerning problems you are aware of or do not care about, use the -qflag option or its short form -w to limit messages to high-severity ones:

# E, S, and U messages go in listing, U messages are displayed on screen
xlf95 -qflag=e:u program.f
 
# E, S, and U messages go in listing and are displayed on screen
xlf95 -w program.f

Selecting the Language for Messages

By default, XL Fortran comes with messages in U.S. English only. You can also order translated message catalogs:

If compile-time messages are appearing in U.S. English when they should be in another language, verify that the correct message catalogs are installed and that the LANG, LC_MESSAGES, and/or LC_ALL environment variables are set accordingly.

If a run-time message appears in the wrong language, also ensure that your program calls the setlocale routine.
Related Information:See Environment Variables for National Language Support, and Selecting the Language for Run-Time Messages.

To determine which XL Fortran message catalogs are installed, use the following commands to list them:

lslpp -f 'xlfcmpm*.msg' # compile-time messages
lslpp -f 'xlfrtem*.msg' # run-time messages

The file names of the message catalogs are the same for all supported international languages, but they are placed in different directories.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ] © Copyright IBM Corporation 1990, 1998.