简体   繁体   English

GCC预处理,内置和命令行是什么?

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

I'm curious about the output of the preprocessing step of GCC. 我很好奇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. 我知道格式是<line_number> <file name> <flags>但我不明白本节中可能出现的数据类型。 What is its purpose? 它的目的是什么?

Thanks! 谢谢!

The purpose is to keep track of the original source line that lead to the expanded code. 目的是跟踪导致扩展代码的原始源代码行。 This is then eg 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. 在您的特定情况下,您似乎在编译开始时捕获了行,然后gcc甚至开始处理输入文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM