GCC 选项 -save-temps 个数字在 header 个文件之后
GCC option -save-temps numbers after header files
当我使用 -save-temps
选项在 gcc 上编译代码时,存储预处理输出的结果 filename.i
包含如下行:
#44 "/usr/include/stdio.h" 3 4
struct _IO_FILE;
其中 44
是 /usr/include/stdio.h
中包含代码 struct _IO_FILE;
的行号。我想知道 header 名字后面的 3 4
是什么。我在 man gcc
中搜索过,但没有找到解释。
https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html#Preprocessor-Output:
Source file name and line number information is conveyed by lines of the form
# linenum filename flags
These are called linemarkers. They are inserted as needed into the output (but never within a string or character constant). They mean that the following line originated in file filename at line linenum. filename will never contain any non-printing characters; they are replaced with octal escape sequences.
After the file name comes zero or more flags, which are 1
, 2
, 3
, or 4
. If there are multiple flags, spaces separate them. Here is what the flags mean:
1
- This indicates the start of a new file.
2
- This indicates returning to a file (after having included another file).
3
- This indicates that the following text comes from a system header file, so certain warnings should be suppressed.
4
- This indicates that the following text should be treated as being wrapped in an implicit extern "C"
block.
当我使用 -save-temps
选项在 gcc 上编译代码时,存储预处理输出的结果 filename.i
包含如下行:
#44 "/usr/include/stdio.h" 3 4
struct _IO_FILE;
其中 44
是 /usr/include/stdio.h
中包含代码 struct _IO_FILE;
的行号。我想知道 header 名字后面的 3 4
是什么。我在 man gcc
中搜索过,但没有找到解释。
https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html#Preprocessor-Output:
Source file name and line number information is conveyed by lines of the form
# linenum filename flags
These are called linemarkers. They are inserted as needed into the output (but never within a string or character constant). They mean that the following line originated in file filename at line linenum. filename will never contain any non-printing characters; they are replaced with octal escape sequences.
After the file name comes zero or more flags, which are
1
,2
,3
, or4
. If there are multiple flags, spaces separate them. Here is what the flags mean:
1
- This indicates the start of a new file.
2
- This indicates returning to a file (after having included another file).
3
- This indicates that the following text comes from a system header file, so certain warnings should be suppressed.
4
- This indicates that the following text should be treated as being wrapped in an implicitextern "C"
block.