This is the mail archive of the
mailing list for the GCC project.
Re: tree.h vs include guard
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Stan Shebs <shebs at apple dot com>
- Cc: Devang Patel <dpatel at apple dot com>,Gabriel Dos Reis <gdr at integrable-solutions dot net>, gcc at gcc dot gnu dot org
- Date: Wed, 14 Aug 2002 07:29:30 +0100
- Subject: Re: tree.h vs include guard
- References: <3D59C969.firstname.lastname@example.org>
Stan Shebs wrote:-
> I thought the current policy was only to include guards if they were really
> necessary, and for most headers they aren't. In general GCC policy is to
> explicitly include every header needed by a source file.
CPP avoids caching a file if it has include guards, assuming that it's
unlikely it will be relevant again (because of the MI optimization).
So even unnecessary include guards save a bit of memory usage by the compiler.