[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: precompiled header suggestion

From: Eric Siegerman
Subject: Re: precompiled header suggestion
Date: Thu, 2 Oct 2003 19:44:01 -0400
User-agent: Mutt/1.2.5i

On Fri, Oct 03, 2003 at 12:36:25AM +0200, Alexandre Duret-Lutz wrote:
>  Tom> There would also have to be a way to disable .gch support
>  Tom> for non-gcc compilers.
> Also I presume some libraries will also want to install such
> files?  Can they be installed?  (Is this what install-pch is
> about in your libstdc++ quote?)  If so, such installation also
> needs to be conditional.

By "install such files", do you mean the .gch files?  IMO,
installing those anywhere (or otherwise exporting them from the
build tree where they were created) should be *strongly*
discouraged!  They seem to be pretty fragile, in that any change
to just about anything invalidates the .gch; and the GCC
documentation admits that the compiler can't check for all such
cases (though they do appear to come admirably close).

Thus, it seems to me that the .gch should remain as local, and as
easily blown away and rebuilt, as possible -- and stashing the
thing in /usr/local/include violates both of those!

A .gch adds no value; it's purely an optimization.  Nothing wrong
with that, of course -- as long as it doesn't cause breakage.
But the cost of bad compiles if GCC doesn't notice that it should
ignore a bogus .gch, is likely to be a lot higher than the cost
of rebuilding the .gch somewhat more frequently than the
theoretical minimum.  And since GCC can't guarantee to avoid such
bum compiles, the build system should do what it can to help
avoid them.

The situation seems very similar to that of Autoconf's
config.cache.  Those files used to be kept between runs by
default, but it was decided that doing so causes too many
problems, so now the default is to throw them away; the user must
ask for the less-safe behaviour.


|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        address@hidden
|  |  /
When I came back around from the dark side, there in front of me would
be the landing area where the crew was, and the Earth, all in the view
of my window. I couldn't help but think that there in front of me was
all of humanity, except me.
        - Michael Collins, Apollo 11 Command Module Pilot

reply via email to

[Prev in Thread] Current Thread [Next in Thread]