Compiler listings

A listing is a type of compiler output that contains information about a particular compilation. As debugging aid, a compiler listing is useful for determining what has gone wrong in a compilation. For example, any diagnostic messages emitted during compilation are written to the listing.

Use the -qsource option to request a listing. Listing information is organized in sections. A listing contains a header section and a combination of other sections, depending on other options in effect. The contents of these sections are described as follows.

Header section
Lists the compiler name, version, and release, as well as the source file name and the date and time of the compilation.
Source section
Lists the input source code with line numbers. If there is an error at a line, the associated error message appears after the source line. Lines containing macros have additional lines showing the macro expansion. By default, this section only lists the main source file. Use the -qshowinc option to expand all header files as well.
Options section
Lists the nondefault options that were in effect during the compilation. To list all options in effect, specify the -qlistopt option.
Attribute and cross-reference listing section
Provides information about the variables used in the compilation unit, such as type, storage duration, scope, and where they are defined and referenced. This section is only produced if the options -qattr and -qxref options in effect. Independently, each of these options provides different information on the identifiers used in the compilation.
File table section
Lists the file name and number for each main source file and #include file. Each file is associated with a file number, starting with the main source file, which is assigned file number 0. For each file, the listing shows from which file and line the file was included. If the -qshowinc option is also in effect, each source line in the source section will have a file number to indicate which file the line came from.
Compilation epilogue section
Displays a summary of the diagnostic messages by severity level, the number of source lines read, and whether or not the compilation was successful.
Object section
Lists the object code generated by the compiler. This section is useful for diagnosing execution time problems, if you suspect the program is not performing as expected due to code generation error. This section is only produced if the -qlist option is in effect.

Related information