Separate preprocess and compile: hack or feature?

Boris Kolpackov
Thu May 11 09:13:00 GMT 2017


In the build system I am working on we are looking at always performing
the preprocessing and then C/C++ compilation as two separate gcc/g++
invocations. The main reason is support for distributed compilation but
see here[1] for other reasons.

I realize that tools like ccache/distcc have been relying on this for
a while (though see the 'direct' mode in ccache and 'pump' in distcc).
However, some compilers apparently do not support this (for example,
VC; see the above link for details).

So I wonder, in the context of GCC, if this is just a hack that happens
to work "for now" or if this is a feature that is expected to continue
to work?

Also, has anyone seen/heard of any real-world issues with compiling
preprocessed source code?



More information about the Gcc mailing list