This is the mail archive of the
mailing list for the GCC project.
Re: Problem with PFE approach [Was: Faster compilation speed]
- From: "Timothy J. Wood" <tjw at omnigroup dot com>
- To: dberlin at dberlin dot org
- Cc: Devang Patel <dpatel at apple dot com>, Mike Stump <mrs at apple dot com>, <gcc at gcc dot gnu dot org>
- Date: Sat, 17 Aug 2002 20:14:14 -0700
- Subject: Re: Problem with PFE approach [Was: Faster compilation speed]
On Saturday, August 17, 2002, at 08:04 PM, Daniel Berlin wrote:
I'm not saying that I'm #including it in my sources. What I'm saying
is that the IDE knows that all my files depend upon it (they all end up
including it due to it being the prefix header, regardless of whether
it is listed or not). This means that they may have depedencies on the
its contents and must be rebuilt if it or any header it includes
On Sat, 17 Aug 2002, Timothy J. Wood wrote:
So, another problem with PFE that I've noticed after working with
for a while...
If you put all your commonly used headers in a PFE, then changing
of these headers causes the PFE header to considered changed. And,
since this header is imported into every single file in your project,
you end up in a situation where changing any header causes the entire
project to be rebuilt.
Um, this header should *not* be explicitly included in the files.
It's *prefix* header.
The way I think about this is that the prefix header mess is just a
hack to avoid having a #include at the top of each file. There should
be nothing else special about the header -- it is just assumed that
there is a #include at the top of your file.
The only thing that would need to be rebuilt in this case is the
Nope... everything needs to be rebuilt. The problem is that the
prefix header might satisfy some symbol or macro that a source file
needs (assume that the source file doesn't explicitly include headers
it needs). If the only approach to PCH is having a prefix header, then
this is the way things are going to end up working -- people will not
#include the correct set of headers (they will try, but they will
Everything else that would normally not be rebuilt will not be rebuilt.
Thus, the only (correct) choice the IDE has is to treat the PFE as a
included file. To do otherwise will cause the user to potentially get
unexpected results (and we're back to the usability issue again).