pch support

Rolf Kalbermatter rolf.kalbermatter at citeng.com
Thu Jan 12 14:02:42 CST 2006


Thomas Weidenmueller wrote:

> We've been using PCH with GCC for a long time in ReactOS, it's been
> working very well and reliable. Compiling ReactOS is *a lot* 
> faster with
> PCH enabled.

Basically what I get in MSVC 6 when modifing a header somewhere and PCH is enabled is that MSVC keeps mocking about errors in the
headers, my change was supposed to fix. Disabling PCH (and sometimes deleting the *.pch file) always fixes those issues.

The issues about getting all the necessary headers in one single include file is, that sometimes certain headers conflict but one is
used in one particular source file and another one in another source file. Of course you can always fix those issues by adding
precompiler conditions around certain declarations or even complete include declarations, and that would be the prefered solution
but sometimes this can't be easily done because you might break compilation on a different platform or with a different header
set/compiler.

I think PCH is fine as long as you do not need to modify anything about the source files and the preprocessor creating the pch file
is smart enough to correctly track all possible dependancies.

Apparently this seems not possible: MSVC seems to have trouble tracking dependancies reliable but does not require to put all used
headers in a special include file, and gcc does require this modification but does not have trouble to track proper dependancies (or
I have never understood how PCH is supposed to work under MSVC, but for me not having projects containing million lines of c code,
disabling PCH always was the most simple and reliable solution). 
 
Rolf Kalbermatter





More information about the wine-devel mailing list