lkml.org 
[lkml]   [2005]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: Missing #include <config.h>
    From
    Date
    On Tue, 2005-09-13 at 15:28 +0100, Russell King wrote:
    > On Tue, Sep 13, 2005 at 09:12:33AM -0500, Josh Boyer wrote:
    > > On Tue, 2005-09-13 at 14:56 +0100, Jörn Engel wrote:
    > > > After spending some hours last night and this morning hunting a bug,
    > > > I've found that a different include order made a difference. Some
    > > > files don't work correctly, unless config.h is included before.
    > > >
    > > > Here is a very stupid bug checker for the problem class:
    > > > $ rgrep CONFIG include/ | cut -d: -f1 | sort -u > g1
    > > > $ rgrep CONFIG include/ | cut -d: -f1 | sort -u | xargs grep "config.h" | cut -d: -f1 | sort -u > g2
    > > > $ diff -u g1 g2 | grep ^- > g3
    > >
    > > Your checker doesn't quite test for nested includes. E.g. if foo.h
    > > includes bar.h, and bar.h includes config.h, then foo.h doesn't need to
    > > include config.h explicitly.
    >
    > Unfortunately, we don't operate like that. If a file makes use of
    > CONFIG_xxx then it must include <linux/config.h>.

    Well, that rule makes things easier then, so Jörn's list would be pretty
    complete.

    Your proposal of using -imacros is even better though.

    josh

    -
    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-09-13 16:43    [W:0.023 / U:58.140 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site