lkml.org 
[lkml]   [2002]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Re: 2.5.3-pre1 compile error
From
Date
dmeyer <dmeyer@dmeyer.net> writes:
> In article <20020116015513.L32088@suse.de> you write:

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

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

--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:23    [W:0.022 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site