Re: [kbuild-devel] Re: Announce: Kernel Build for 2.5, release 3.0 is available

Keith Owens (kaos@ocs.com.au)
Wed, 05 Jun 2002 12:38:18 +1000


On Tue, 4 Jun 2002 22:25:20 -0400 (EDT),
John Cowan <jcowan@reutershealth.com> wrote:
>Keith Owens scripsit:
>
>> In order to do separate source and object correctly, kbuild 2.5
>> enforces the rule that #include "" comes from the local directory,
>> #include <> comes from the include path. include/linux/zlib.h
>> incorrectly does #include "zconf.h" instead of #include <linux/zconf.h>,
>> breaking the rules.
>
>This is not the standard gcc behavior, however; quoted-includes
>can come from the include path, although the current directory
>is searched first. The purpose of <>-includes is to suppress
>searching the current directory.

What gcc allows and what the kernel uses as a coding style are two
different things. Almost all of the kernel uses <> for global files
and "" for local files, this is the only sane way of coding for a large
project. However there are some exceptions where the wrong form has
been used.

The wrong form causes problems for separate source and object
directories. It also causes problems when you do not compile in the
same directory that does not contain the source, i.e. when you do a
global make instead of recursive make. kbuild 2.5 has identified all
of the problem includes. I avoided changing the source, instead I
added extra include paths as a temporary workaround, with FIXME
comments for later clean up. I noticed that some people have already
used the kbuild 2.5 FIXME comments to clean up their code.

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