Skip to contentSkip to conversation

2.5.3-pre1 compile error

PATCH Russ Allbery 1 participant 1 message Jan 16, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 7 lines · dmeyer

In article <[email protected]> you write:

Quoted 5 lines

I'm sure I read somewhere that gcc is clever enough to know when it hits a #include, it checks for a symbol equal to a mangled version of the filename before including it. (Ie, doing this transparently).

Then again, I may have imagined it all.

No, you read that gcc notices when the entirety of a source file is wrapped in an #ifdef guard and won't re-read that file when it's included again if the symbol is defined.

Quoted 3 lines

In answer to Linus' question...yes, in a large system redundent include guards can make a real difference, particularly for headers which get included by other headers regularly.

Yes, but you don't need to put them around the #include. Just make sure there is nothing but comments outside the multiple inclusion guards in the header files and any competent compiler will do the right thing.

Signature · 1 line
Russ Allbery ([email protected])             <http://www.eyrie.org/~eagle/>