public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Osterlund <petero2@telia.com>
To: Dave Jones <davej@suse.de>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	David Weinehall <tao@acc.umu.se>,
	Benjamin LaHaise <bcrl@redhat.com>, John Weber <weber@nyc.rr.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Re: 2.5.3-pre1 compile error
Date: 16 Jan 2002 19:32:38 +0100	[thread overview]
Message-ID: <m2sn96no3d.fsf@ppro.localdomain> (raw)
In-Reply-To: <20020116013811.E5235@khan.acc.umu.se> <Pine.LNX.4.33.0201151639320.1213-100000@penguin.transmeta.com> <20020116015513.L32088@suse.de>
In-Reply-To: <20020116015513.L32088@suse.de>

Dave Jones <davej@suse.de> writes:

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

Not exactly, but there is an optimization in cpp that makes it
possible to do the cleanup Linus wants without sacrificing
performance. From the cpp info pages:

        The GNU C preprocessor is programmed to notice when a header
        file uses this particular construct and handle it efficiently.
        If a header file is contained entirely in a `#ifndef'
        conditional, modulo whitespace and comments, then it remembers
        that fact.  If a subsequent `#include' specifies the same
        file, and the macro in the `#ifndef' is already defined, then
        the directive is skipped without processing the specified file
        at all.

I did an strace on cpp to verify that this optimization actually
works.

-- 
Peter Osterlund - petero2@telia.com
http://w1.894.telia.com/~u89404340

  parent reply	other threads:[~2002-01-16 18:33 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
2002-01-16 18:32           ` Peter Osterlund [this message]
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=m2sn96no3d.fsf@ppro.localdomain \
    --to=petero2@telia.com \
    --cc=bcrl@redhat.com \
    --cc=davej@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tao@acc.umu.se \
    --cc=torvalds@transmeta.com \
    --cc=weber@nyc.rr.com \
    /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