请教:ms编译器能否输出宏展开和头文件展开后的结果,或者类的功能

C/C++本地代码调试

请教:ms编译器能否输出宏展开和头文件展开后的结果,或者类的功能


mingjun 2009-10-27, 15:05 下午
比如:
file1.h

#define DHL  1
void fun();


file2.h:

#include "file.h"
#define AMP 2

void fun2();


file3.c

#include "file2.h"
void main()
{
//balabal
}

那么最后宏和头文件展开后file3.c 如下:

#define DHL  1
void fun();

#define AMP 2
void fun2();

void main()
{
//balabal
}

经常遇到条件宏或者其他的编译时冲突,不好找出问题,不知道有没有类似上述功能的编译器选项?


Re: 请教:ms编译器能否输出宏展开和头文件展开后的结果,或者类的功能


Coding 2009-10-27, 15:59 下午
VC的话你可以试试看“/EP /C“编译选项

Re: 请教:ms编译器能否输出宏展开和头文件展开后的结果,或者类的功能


mingjun 2009-10-28, 17:44 下午
可以的,谢谢

Powered by Community Server Powered by CnForums.Net