[lkml]   [2002]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] Re: 2.5.3-pre1 compile error
    Dave Jones <> 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

    Peter Osterlund -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:23    [W:0.033 / U:6.384 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site