[Python-Dev] Multiple Inclusion of Header Files

Neal Norwitz neal@metaslash.com
Fri, 11 Oct 2002 09:09:16 -0400


On Fri, Oct 11, 2002 at 07:48:52AM -0400, Guido van Rossum wrote:
> > > is there any reason why these files:
> > >     graminit.h
> > >     patchlevel.h 
> > >     pyconfig.h (aka pyconfig.h.in)
> > > 
> > > don't protect against being included multiple times?
> > 
> > I think they cannot possibly be included multiple times in a correct
> > application, since a correct application does not directly include
> > them, anyway.
> 
> But that's true of any .h file that's included by Python.h, isn't it?
> And there's only a handful of .h files that Python.h doesn't include...

I don't really think there is much to be gained by adding protection.
It's unlikely the files would be included directly by an application.
Even if the files are included multiple times, the worst that should
happen is a redefined warning.

Neal