-E 只激活预处理,这个不生成文件,你需要把它重定向到一个输出文件里面. 例子用法: gcc -E hello.c > pianoapan.txt gcc -E hello.c | more 慢慢看吧,一个hello word 也要与处理成800行的代码
-E选项,表示让gcc只进行“预处理”就行了。 所谓的预处理,就是把程序中的宏展开, 把头文件的内容展开包含进来等等一些编译前的预处理操作。 预处理结果会显示到屏幕上,如果需要保存,则得需要重定向
Why does the C preprocessor in GCC interpret the word linux
(small letters) as the constant 1
?
test.c:
#include <stdio.h>
int main(void)
{
int linux = 5;
return 0;
}
Result of $ gcc -E test.c
(stop after the preprocessing stage):
....
int main(void)
{
int 1 = 5;
return 0;
}
Which -of course- yields an error.
(BTW: There is no #define linux
in the stdio.h file.)