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.
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:
- Conditions exist that the compiler could not correct. An object
file is produced; however, you should not attempt to run the
program.
- An internal compiler table has overflowed. Processing of the
program stops, and XL Fortran does not produce an object file.
- An include file does not exist. Processing of the program stops,
and XL Fortran does not produce an object file.
- An unrecoverable program error has been detected. Processing of the
source file stops, and XL Fortran does not produce an object file. You
can usually correct this error by fixing any program errors that were reported
during compilation.
- 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:
- The message levels S and U indicate a compilation
failure.
- 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.
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.
If an XLF-compiled program ends abnormally, the return code to the
operating system is 1.
If the program ends normally, the return code is 0 (by default) or is
MOD(digit_string,256) if the program ends because of a
STOP digit_string statement.
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
- 25
- Indicates a run-time message from an XL Fortran application program
- 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
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
By default, XL Fortran comes with messages in U.S. English
only. You can also order translated message catalogs:
- Compiler messages in Japanese
- Run-time messages in Japanese
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:
rpm -ql xlf.cmp # compile-time messages
rpm -ql xlf.msg.rte # run-time messages
rpm -ql xlsmp.msg.rte # SMP 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.
- Note:
- When you run an XL Fortran program on a system without the XL
Fortran message catalogs, run-time error messages (mostly for I/O problems)
are not displayed correctly; the program prints the message number but
not the associated text. To prevent this problem, copy the XL Fortran
message catalogs from /opt/ibmcmp/msg to a directory that is part of the NLSPATH
environment-variable setting on the execution system.
