【发布时间】:2015-12-19 21:10:07
【问题描述】:
对于一个简单的 C 程序,我做了gcc -E hello.c -o hello.pp 来查看程序在预处理后的样子。
在输出文件中,我可以看到许多以# 开头的行,看起来像注释。这些线是什么?
我怎样才能只看到 C 代码,而没有那些 cmets?
下面是一个sn-p:
user $ gcc -E hello.c -o hello.pp
user $ tail -n 15 hello.pp
extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 943 "/usr/include/stdio.h" 3 4
# 3 "hello.c" 2
int main()
{
printf("Hello world \n");
return 0;
}
user $
【问题讨论】:
-
投票重新打开,因为原来的问题是 “我怎样才能只看到 C 代码,没有那些 cmets?”
标签: c gcc c-preprocessor