tree.h vs include guard

Neil Booth neil@daikokuya.co.uk
Tue Aug 13 23:29:00 GMT 2002


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.
> 
> Stan

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.

Neil.



More information about the Gcc mailing list