2.1.73. --list

This option instructs the compiler to generate raw listing information for a source file. The name of the raw listing file defaults to the name of the input file with the filename extension .lst.

If you specify multiple source files on the command line then raw listing information is generated for only the first of the specified files.

Usage

Typically, raw listing information is used to generate a formatted listing. The raw listing file contains raw source lines, information on transitions into and out of include files, and diagnostics generated by the compiler. Each line of the listing file begins with any of the following key characters that identifies the type of line:

N

A normal line of source. The rest of the line is the text of the line of source.

X

The expanded form of a normal line of source. The rest of the line is the text of the line. This line appears following the N line, and only if the line contains nontrivial modifications. Comments are considered trivial modifications, and macro expansions, line splices, and trigraphs are considered nontrivial modifications. Comments are replaced by a single space in the expanded-form line.

S

A line of source skipped by an #if or similar. The rest of the line is text.

Note

The #else, #elseif, or #endif that ends a skip is marked with an N.

L

Indicates a change in source position. That is, the line has a format similar to the # line-identifying directive output by the preprocessor:

L line-number "filename" key

where key can be:

1

For entry into an include file.

2

For exit from an include file.

Otherwise, key is omitted. The first line in the raw listing file is always an L line identifying the primary input file. L lines are also output for #line directives where key is omitted. L lines indicate the source position of the following source line in the raw listing file.

R/W/E

Indicates a diagnostic, where:

R

Indicates a remark.

W

Indicates a warning.

E

Indicates an error.

The line has the form:

type "filename" line-number column-number message-text

where type can be R, W, or E.

Errors at the end of file indicate the last line of the primary source file and a column number of zero.

Command-line errors are errors with a filename of "<command line>". No line or column number is displayed as part of the error message.

Internal errors are errors with position information as usual, and message-text beginning with (Internal fault).

When a diagnostic message displays a list, for example, all the contending routines when there is ambiguity on an overloaded call, the initial diagnostic line is followed by one or more lines with the same overall format. However, the code letter is the lowercase version of the code letter in the initial line. The source position in these lines is the same as that in the corresponding initial line.

Example

/* main.c */
#include <stdbool.h>

int main(void)
{
    return(true);
}

Compiling this code with the option --list produces the raw listing file:

L 1 "main.c"
N#include <stdbool.h>
L 1 "...\include\...\stdbool.h" 1
N/* stdbool.h */
N
...
N  #ifndef __cplusplus /* In C++, 'bool', 'true' and 'false' and keywords */
N    #define bool _Bool
N    #define true 1
N    #define false 0
N  #endif
...
L 2 "main.c" 2
N
Nint main(void)
N{
N   return(true);
X   return(1);
N}

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential