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 to the listing file.

The compiler issues messages specific to the C or C++ language, and XL messages common to all XL compilers.

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 the error is identifiable within the source line, a finger line under the source line points to the column position of the error. For example:

       10 | int add(int, int)
            ....a...b....c...
a - 1506-166 (S) Definition of function add requires parentheses.
b - 1506-172 (S) Parameter type list for function add contains
parameters without identifiers.
c - 1506-172 (S) Parameter type list for function add contains
parameters without identifiers.

The compiler also places messages in the source listing if you specify the -qsource option.

If langlvl is set to ansi, compile-time messages about incorrect #pragma directives are not generated.

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 a useful debugging aid. 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:



Compiler Message Format
Error Severity Levels and Compiler Response