This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with PFE approach [Was: Faster compilation speed]
> On Sun, 18 Aug 2002, Timothy J. Wood wrote:
> > I can accept an argument of "this is too hard to do correctly right
> > now", but not "the user screwed up". The user didn't screw up -- the
> > compiler just isn't smart enough to do it correctly yet.
On Mon, Aug 19, 2002 at 11:21:28AM +0200, Michael Matz wrote:
> If the source doesn't compile without the prefix header the user did
> something wrong, IOW he's screwed if he doesn't want to fix it. Period.
PFE makes it too easy for the programmer to accidentally give his program
different meaning with or without the prefix header. I can do without one
more way to screw up my program.
The following set of files will compile a program with or without PFE, but
using a PFE that contains both a.h and b.h, the behavior will change. So
the suggestion that files should be checked that they compile without PFE
is not enough to ensure that there aren't unintended changes in program
meaning in the presence of PFE.
// a.h
#define DEFA
// b.h
#define DEFB
// m.c
#include "a.h"
int main(void) {
#ifdef DEFB
return 1;
#else
return 0;
#endif;
}