gpt4 book ai didi

c - 预处理器输出字段

转载 作者:行者123 更新时间:2023-11-30 16:58:35 25 4
gpt4 key购买 nike

我在预处理器输出中有这些行。

……

  • 1“测试.c”
  • 1 "/usr/include/stdio.h"1 3 4
  • 27“/usr/include/stdio.h”3
  • 4 1 "/usr/include/features.h"1 3 4
  • 374“/usr/include/features.h”1 3 4

……

我知道在 stdio.h 的第 27 行有一个包含 features.h 的调用,但是这两行中的其他数字 1,3,4 定义了什么。谁能详细解释一下这些不同的领域到底意味着什么。

如你所见

1“/usr/include/stdio.h”1 3 4

27“/usr/include/stdio.h”3 4

为什么两次包含 stdio.h 或者如果我错了那意味着什么?

最佳答案

来自海湾合作委员会documentation :

Source file name and line number information is conveyed by lines ofthe form

# linenum filename flags

These are called linemarkers. They are inserted as needed into the output (but never within a string orcharacter constant). They mean that the following line originated infile filename at line linenum. filename will never contain anynon-printing characters; they are replaced with octal escapesequences.

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 iswhat 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, socertain warnings should be suppressed.

‘4’ This indicates that the following text should be treated as being wrapped in an implicit extern "C" block.

关于c - 预处理器输出字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38693559/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com