Compiler Message and Listing Information

When the compiler encounters a programming error while compiling a C or C++ source program, it issues a diagnostic message to the standard error device and if the appropriate options have been selected, to the listing file.

Compiler Messages

The compiler issues messages specific to the C or C++ language.

Artwork for ngclang If you specify the compiler option -qsrcmsg and the error is applicable to a particular line of code, the reconstructed source line or partial source line is included with the error message in the stderr file. A reconstructed source line is a preprocessed source line that has all the macros expanded.

If you specify the -qsource compiler option, the compiler will place messages in the source listing. For example, if you compile your file using the command line invocation xlc -qsource filename.c, then you will find a file called filename.lst in your current directory.

You can control the diagnostic messages issued, according to their severity, using either the -qflag option or the -w option. To get additional informational messages about potential problems in your program, use the -qinfo option.

Compiler Listings

The listings produced by the compiler are useful for debugging. By specifying appropriate options, you can request information on all aspects of a compilation. The listing consists of a combination of the following sections:

Each section, except the header section, has a section heading that identifies it. The section heading is enclosed by angle brackets.

Related References

Message Severity Levels and Compiler Response
Compiler Message Format
flag
info
source
srcmsg
w IBM Copyright 2003