Tim Merrifield
Tim Merrifield

Reputation: 6268

GCC preprocessing, what are the built-in and command-line lines for?

I'm curious about the output of the preprocessing step of GCC. More precisely, what is the purpose of the following two lines:

# 1 "<built-in>"
# 1 "<command line>"

I know that the format is <line_number> <file name> <flags> but I don't understand what type of data might appear in this section. What is its purpose?

Thanks!

Upvotes: 4

Views: 481

Answers (1)

Jens Gustedt
Jens Gustedt

Reputation: 78993

The purpose is to keep track of the original source line that lead to the expanded code. This is then e.g used when you compile with debugging to tell the debugger the code lines through which your are stepping.

In your particular case you seem to have captured lines at the beginning of compilation, before gcc even started to process an input file.

Upvotes: 1

Related Questions