Re: [PATCH] make sparse headers self-compilable...

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

 



On Tue, Aug 11, 2009 at 11:40, Christopher Li<sparse@xxxxxxxxxxx> wrote:
> On Sat, Aug 8, 2009 at 4:10 AM, Kamil Dudka<kdudka@xxxxxxxxxx> wrote:
>> On Friday 07 of August 2009 22:27:08 Kamil Dudka wrote:
>>> attached is another fix for SPARSE headers improving their sanity. I am
>>> also attaching a simple test for the dependency tracking of headers. It's
>>> not enough generic and portable and therefore not really useful. Maybe
>>> someone skilled in writing makefiles might want to include something like
>>> that to the SPARSE Makefile as part of the 'check' target.
>
> What is the significant of making every header file self compilable?
> Unlike the kernel header files exported to user space, which usually
> have self contained meaning. Most of these header file have tight interaction
> with each other. I don't think it make sense for other sparse application
> to just use one of the header file.
>
> Enforcing each header file to be self compilable will result in a lot
> of unnecessary include. Gcc needs to include "symbol.h" many times
> just to skip over it. Take a look at pre-process.c. It is not exactly
> trivial. It needs to scan the token to find out the end of the if
> scope. In this case, it might be better just let other header
> file depend on "symbol.h".
>
> I want to heard what other people think about it too. I am a little bit
> reluctant on this one.

What about just using some forward decls instead of including the header files?

e.g. for compile.h it is enough to have a "struct symbol;" there
instead of the "#include <symbol.h>" to make it self-compilable.

Cheers,
-Hannes
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux