This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC-HEAD [3.4] PCH and multiple header support?


Neil Booth <neil@daikokuya.co.uk> writes:

> Joe Buck wrote:-
> 
> > Unfortunately, the meaning of a header depends on what has been
> > included before, or defined before.  In that sense, the only
> > reusable unit that works reliably is the very first header.
> 
> I'm not sure what the current PCH implementation does, but if what
> you say above is what is implemented, it is certainly possible to be
> a lot more intelligent about it.
> 
> Existence proofs are the EDG, Borland and MS compilers.

I'm a GCC, Intel, KAI and Borland user. Indeed, EDG and Borland are
smarter than GCC-PCH. However, the most efficient way (both
performance-wise and maintenance-wise) of organizing your usage of
precompiled headers on those compilers is to create a .h file which
#includes the headers to be precompiled, and #include that special
header file on all .cpp files, followed by a "#pragma hdrstop" to
exclude subsequent headers of being precompiled. So, from the POV of
the experienced Borland users I know, GCC does just the right thing.

The KAI documentation recommends the single common header approach
(see the User's guide (available as a PDF on
http://developer.intel.com/software/products/kcc/documentation.htm )
tutorials chapter, precompiled headers, "Organizing Your Sources to
Improve PCH Performance"). For Borland, from a TeamB member, the
de-facto standard reference for PCH usage says the same:
 
http://www.bcbdev.com/articles/pch.htm

[snip]

I think we all agree that GCC seriously needs an improvement on
compile times. It's painfully slow compared with the other compilers (I
use MinGW as my main compiler, though. Thanks to you all!)

-- 
Oscar


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]