Compile without generating output file in GCC
问题 $ gcc -c somefile.c compiles without linking and generates the corresponding somefile.o . Is it possible to compile files in gcc without generating any output file? I know there are other ways to achieve this but I'm curious on whether there is a flag just for going through the source code looking for errors/warnings. 回答1: You may like the -fsyntax-only option. It does not write anything on disk, just checks that the code is valid. You can check that it does not write anything on disk with