mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Boyer <jdub@us.ibm.com>
To: "Jörn Engel" <joern@infradead.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Missing #include <config.h>
Date: Tue, 13 Sep 2005 09:12:33 -0500	[thread overview]
Message-ID: <1126620753.3209.3.camel@windu.rchland.ibm.com> (raw)
In-Reply-To: <20050913135622.GA30675@phoenix.infradead.org>

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.

For a more concrete example, take include/asm-i386/kprobes.h from your
list.  That includes linux/types.h, which includes linux/config.h.

Making a tool that takes that into account could be interesting.

josh


  parent reply	other threads:[~2005-09-13 14:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13 13:56 Jörn Engel
2005-09-13 14:08 ` Russell King
2005-09-13 14:12   ` Christoph Hellwig
2005-09-13 17:57     ` Geert Uytterhoeven
2005-09-13 18:02       ` Russell King
2005-09-13 14:50   ` [PATCH] Permanently fix kernel configuration include mess (was: Missing #include <config.h>) Russell King
2005-09-13 16:59     ` Joern Engel
2005-09-13 18:04       ` Russell King
2005-09-13 19:10         ` [PATCH] Permanently fix kernel configuration include mess Brian Gerst
2005-09-13 19:33           ` Josh Boyer
2005-09-13 20:10             ` Alexey Dobriyan
2005-09-14  8:39     ` [PATCH] Permanently fix kernel configuration include mess (was: Missing #include <config.h>) Andrew Morton
2005-09-14  8:48       ` Russell King
2005-09-14 13:48       ` Sergey Vlasov
2005-09-14 14:02       ` Christoph Hellwig
2005-09-14 17:04       ` Sam Ravnborg
2005-09-13 14:12 ` Josh Boyer [this message]
2005-09-13 14:28   ` Missing #include <config.h> Russell King
2005-09-13 14:40     ` Josh Boyer
2005-09-13 16:22   ` Doug Maxey
2005-09-13 17:55 ` Geert Uytterhoeven

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=1126620753.3209.3.camel@windu.rchland.ibm.com \
    --to=jdub@us.ibm.com \
    --cc=joern@infradead.org \
    --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

all inboxes | Powered by JetHome®