-qxref

Category

Listings, messages, and compiler information

Pragma equivalent

#pragma options [no]xref

Purpose

Produces a compiler listing that includes the cross-reference component of the attribute and cross-reference section of the listing.

When xref is in effect, a listing file is generated with a .lst suffix for each source file named on the command line. For details of the contents of the listing file, see Compiler listings.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-noxref------------.   
>>- -q--+-xref--+---------+-+----------------------------------><
                '-=--full-'     

Defaults

-qnoxref

Parameters

full
Reports all identifiers in the program. If you specify xref without this suboption, only those identifiers that are used are reported.

Usage

A typical cross-reference listing has the form:

Cross-reference listing

The listing uses the following character codes:
Table 1. Cross-reference listing codes
Character Meaning
X Function is declared.
Y Function is defined.
Z Function is called.
$ Type is defined, variable is declared/defined.
# Variable is assigned to.
& Variable is defined and initialized.
[blank] Identifier is referenced.
{ and } Coordinates of the { and } symbols in a structure definition.

The -qnoprint option overrides this option.

Any function defined with the #pragma mc_func directive is listed as being defined on the line of the pragma directive.

Predefined macros

None.

Examples

To compile myprogram.c and produce a cross-reference listing of all identifiers, whether they are used or not, enter:
xlc myprogram.c -qxref=full

Related information