Re: Missing #include <config.h>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux