金庆的专栏

  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  423 随笔 :: 0 文章 :: 454 评论 :: 0 Trackbacks
调用预编译器cpp预编译main.cpp生成main.i文件:
    $cpp main.cpp > main.i
或者:
    $gcc -E main.cpp > main.i

生成的行号标志中有如下格式的:
    # 1 “/usr/include/features.h” 1 3 4
表示下面的内容是由某个文件的第几行产生的。
但是最后面的几个数字是什么意思?看不出来是什么。

查到的结果是:http://tigcc.ticalc.org/doc/cpp.html

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.


posted on 2010-09-15 10:53 金庆 阅读(561) 评论(0)  编辑 收藏 引用 所属分类: 1. C/C++4. Linux/Unix

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理