I have googled turning off the gcc preprocessor on linux for a good while now (using that exact phrase) and everything has been irrelevant. For example I want to turn off everything except the preprocessor (the opposite of what I want) or pressurising warnings. Does anyone know of a way to disable the preprocessor? I found one that Facebook developed and claimed is faster, and I would like to test it out.
I tested what lornix said in a comment, and it works:
Name the other/newer preprocessor "cpp" and put it in your path, and rename the original cpp to cpp-other or cpp-orig. It'll work great considering you are attempting to replace cpp anyways.
Name your file program.i instead of program.c and it will be treated as already pre-processed by GCC/Clang and sent directly to the compiler.
Example:
$ cat t.i
int printf(const char *f, ...);
int main(){
printf("hello world\n");
}
$ gcc t.i && ./a.out
hello world
来源:https://stackoverflow.com/questions/24561769/how-do-i-turn-off-the-gcc-preprocessor-on-linux