使用此选项,我在预处理后接收文件。有很多类似以下的行:
# 91 "/usr/include/stdint.h" 3 4
这些数字代表什么意思?一开始我以为
#91
是文件包含的行号,但事实并非如此。至于3 4
,我完全不知道它表示什么。使用此选项,我在预处理后接收文件。有很多类似以下的行:
# 91 "/usr/include/stdint.h" 3 4
#91
是文件包含的行号,但事实并非如此。至于3 4
,我完全不知道它表示什么。根据官方文档,该行的格式为:
# linenum filename flags
linenum
参数指定了下一行代码的来源位置,即在filename
文件中的行数。然后有四个标志:
1
- 新文件的开头2
- 返回到文件中3
- 系统头文件4
- 将其视为被包含在extern "C"
中因此,让我们解释一下您的line marker:
# 91 "/usr/include/stdint.h" 3 4
/usr/include/stdint.h
的第 91 行。它是一个系统头文件,应该被视为包含在 extern "C"
中。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 implicitextern "C"
block.
这里有一些标志(用空格隔开),它们的含义如下:
1 - Start of a new file
2 - Returning to previous file
3 - Following text comes from a system header file (#include <> vs #include "")
4 - Following text should be treated as being wrapped in an implicit extern "C" block.