Sun Studio 12: Fortran User's Guide

3.4.110 –Xlist[x]

Produce listings and do global program checking (GPC).

Use this option to find potential programming bugs. It invokes an extra compiler pass to check for consistency in subprogram call arguments, common blocks, and parameters, across the global program. The option also generates a line–numbered listing of the source code, including a cross reference table. The error messages issued by the -Xlist options are advisory warnings and do not prevent the program from being compiled and linked.

Note –

Be sure to correct all syntax errors in the source code before compiling with -Xlist. Unpredictable reports may result when run on a source code with syntax errors.

Example: Check across routines for consistency:

 demo% f95 -Xlist  fil.f

The above example writes the following to the output file fil.lst:

By default, the listings are written to the file name.lst, where name is taken from the first listed source file on the command line.

A number of sub–options provide further flexibility in the selection of actions. These are specified by suffixes to the main -Xlist option, as shown in the following table

Table 3–9 –Xlist Suboptions




Show errors, listing, and cross reference table 


Show call graphs and errors 


Show errors 


Suppress error nnn messages


Show errors, listing, and cross references, but no object files 


Terminate compilation if errors detected 


Analyze #include and INCLUDE files as well as source files


Show listing and errors only 


Set page length to n lines


Check OpenMP directives (SPARC)

–Xlisto name

Output report file to name instead of file.lst


Suppress unreferenced names from the cross–reference table 


Set checking level to n (1,2,3, or 4) -default is 2


Set width of output line to nnn columns -default is 79


Suppress warning nnn messages


Show cross–reference table and errors 

See the Fortran Programming Guide chapter “Program Analysis and Debugging” for details.