From: dmeyer@dmeyer.net
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Re: 2.5.3-pre1 compile error
Date: Tue, 15 Jan 2002 21:10:21 -0500 [thread overview]
Message-ID: <20020115211021.A32400@jhereg.dmeyer.net> (raw)
In-Reply-To: <20020116013811.E5235@khan.acc.umu.se> <Pine.LNX.4.33.0201151639320.1213-100000@penguin.transmeta.com>
In-Reply-To: <20020116015513.L32088@suse.de>
In article <20020116015513.L32088@suse.de> you write:
> On Tue, Jan 15, 2002 at 04:41:08PM -0800, Linus Torvalds wrote:
> > > #ifndef _LINUX_POSIX_TYPES_H /* __FD_CLR */
> > > #include <linux/posix_types.h>
> > > #endif
> > If this actally makes any noticeable difference to compilation speed I
> > could live with it. Does it?
>
> 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.
I'm pretty sure you did, since it's perfectly legal (and occasionally
useful, if gruesome) to do
#define THE_STRUCT struct1
#include "struct_def.h"
#undef THE_STRUCT
#define THE_STRUCT struct2
#include "struct_def.h"
and have both #includes work. You may be thinking of #import, which
is deprecated except for objective-c, IIRC.
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. OTOH, my last
experience using them was on an underpowered Solaris box, which (a)
didn't have enough memory for all the developers compiling on it and
(b) was running an old Solaris, so its read caching was pretty lame
anyway. It makes rather a lot of difference if the preprocessor has
to read <linux/posix_types.h> from the disk 20 times or if it can get
it from the file cache 20 times.
--
Dave Meyer
dmeyer@dmeyer.net
next prev parent reply other threads:[~2002-01-16 2:10 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-16 0:05 2.5.3-pre1 compile error John Weber
2002-01-16 0:20 ` [PATCH] " Benjamin LaHaise
2002-01-16 0:29 ` Linus Torvalds
2002-01-16 0:38 ` David Weinehall
2002-01-16 0:41 ` Linus Torvalds
2002-01-16 0:55 ` Dave Jones
2002-01-16 2:10 ` dmeyer [this message]
2002-01-16 18:32 ` Peter Osterlund
2002-01-16 0:43 ` Benjamin LaHaise
2002-01-16 0:44 ` Linus Torvalds
2002-01-16 0:52 ` Benjamin LaHaise
2002-01-16 1:18 ` David Weinehall
2002-01-17 22:11 ` Christopher Turcksin
2002-01-16 1:24 ` Robert Love
2002-01-16 1:25 ` Benjamin LaHaise
2002-01-16 1:39 ` Robert Love
2002-01-16 0:46 ` Davide Libenzi
2002-01-16 0:43 ` Linus Torvalds
2002-01-16 0:52 ` David S. Miller
2002-01-16 1:06 ` Andre Hedrick
2002-01-16 1:17 ` Davide Libenzi
2002-01-16 1:23 ` Davide Libenzi
[not found] <20020115194425.J17477@redhat.com>
2002-01-16 0:52 ` Davide Libenzi
2002-01-16 1:16 ` David Weinehall
2002-01-16 1:24 ` Davide Libenzi
[not found] <fa.oa9ld7v.gk65b0@ifi.uio.no>
[not found] ` <fa.g97h3fv.968725@ifi.uio.no>
2002-01-16 4:59 ` Russ Allbery
[not found] <20020115192048.G17477@redhat.com.suse.lists.linux.kernel>
[not found] ` <Pine.LNX.4.33.0201151628440.1140-100000@penguin.transmeta.com.suse.lists.linux.kernel>
2002-01-16 11:27 ` Andi Kleen
2002-01-16 11:39 ` Dave Jones
2002-01-17 7:40 ` Neil Booth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020115211021.A32400@jhereg.dmeyer.net \
--to=dmeyer@dmeyer.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox