woaidongmao

文章均收录自他人博客,但不喜标题前加-[转贴],因其丑陋,见谅!~
随笔 - 1469, 文章 - 0, 评论 - 661, 引用 - 0
数据加载中……

VC中得到预编译后代码

/P   (Preprocess to a File)

HomeOverviewHow Do ICompiler Options

This option writes preprocessor output to a file with the same base name as the source file, but with the .I extension. It adds #line directives to the output file at the beginning and end of each included file and around lines removed by preprocessor directives that specify conditional compilation. The preprocessed listing file is identical to the original source file, except that all preprocessor directives are carried out, and macro expansions are performed.

This option suppresses compilation; CL does not produce an .OBJ file, even if the /Fo option is specified. The /P option also suppresses production of the alternate output files created by the /FA, /Fa, or /Fm option.

The /P option is similar to the /E and /EP options. Using /EP with /P suppresses placement of #line directives in the output file.

The following table summarizes the actions of the /E, /EP, and /P options.

Option Preprocessor output
includes #line directives?
Output sent to
/E Yes stdout
/P Yes .i file
/EP No stdout
/E  /EP No stdout
/P  /EP No .i file



Send feedback to MSDN. Look here for MSDN Online resources.

1、一般用/P  /EP,这样就没有#line了,生成的是.i文件

2、利用这个,可以看有很多复杂宏,预编译之后的源代码,比如stl, boost等,#include的代码和相关代码,都会是被剥离后的,出现在同一个文件里,这个对于阅读代码比较有用。

posted on 2008-05-09 14:52 肥仔 阅读(881) 评论(1)  编辑 收藏 引用 所属分类: VC 存档

评论

# re: VC中得到预编译后代码  回复  更多评论   

具体在VC中怎么设置呢?
2009-02-27 17:29 | metal

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