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:
Notes:
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
The compiler return codes and their respective meanings are as follows:
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.
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--) --' >--------------------------------------------------------------><
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:
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.