![](/img/trans.png)
[英]How do I strip out inactive #if directives with the gcc/g++ preprocessor?
[英]How do I turn off the gcc preprocessor on linux?
我已经google了一段时间turning off the gcc preprocessor on linux
(使用那个确切的短语),一切都无关紧要。 例如,我想关闭除预处理器之外的所有内容(与我想要的相反)或加压警告。 有谁知道禁用预处理器的方法? 我发现Facebook开发和声称的更快,我想测试一下。
将文件命名为program.i
而不是program.c
,它将被视为已经由GCC / Clang预处理并直接发送给编译器。
例:
$ cat t.i int printf(const char *f, ...); int main(){ printf("hello world\n"); } $ gcc t.i && ./a.out hello world
我测试了lornix在评论中所说的内容,它有效:
将其他/更新的预处理器命名为“cpp”并将其放入路径中,并将原始cpp重命名为cpp-other或cpp-orig。 考虑到你试图替换cpp,它会很好用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.