This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC-HEAD [3.4] PCH and multiple header support?
- From: Karel Gardas <kgardas at objectsecurity dot com>
- To: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Thu, 23 Jan 2003 08:06:55 +0100 (CET)
- Subject: Re: GCC-HEAD [3.4] PCH and multiple header support?
Oscar Fuentes <ofv@wanadoo.es> wrote:
>
> Neil Booth <neil@daikokuya.co.uk> writes:
>
> > 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.
I'm a GCC and Comeau user and I have to say that I'm happy that someone
come and implement PCH for GCC.
I don't see any problem with organizing sources to be more effective while
PCH are in used, anyway I did the same for Comeau and so now I'm using one
header/#pragma hdrstop model. On the other hand, what is IMHO annoying is
that GCC doesn't support automatic PCH generation. i.e. with this option
(in case of como --pch [1]) I don't need to rearrange our makefiles to
compile headers 'manually' and then compile normal sources, but compiler
will compile necesary headears automatically while compiling the first c++
file which uses them.
Of course Comeau supports manual precompiled header processing too: it
provides two other options for it: --create_pch and --use_pch, but I don't
find anything usefull on them, so as I said, I don't use them now.
IMHO it would be fantastic if GCC supports automatic precompiled header
processing too.
Anyway, thanks to everyone for this feature in GCC,
Karel
[1] http://www.comeaucomputing.com/4.0/docs/userman/pch.html
--
Karel Gardas kgardas@objectsecurity.com
ObjectSecurity Ltd. http://www.objectsecurity.com