Re: Linux 2.6.0-test6

From: Jörn Engel
Date: Sun Sep 28 2003 - 15:02:00 EST


On Sun, 28 September 2003 20:42:24 +0100, Russell King wrote:
>
> I have a bad feeling about this, so I'll make the following comments
> up front before all the reports start rolling in. It may be a good
> idea to document this somewhere. (Coding style?)
>
> If a header has something like these:
>
> struct my_headers_struct {
> struct task_struct *tsk;
> };
>
> void my_function(struct task_struct *tsk);
>
> and gcc warns that "struct task_struct" has not been declared, please
> don't think about adding another header. Just declare the structure
> in the header file which needs it like this:
>
> struct task_struct;
>
> and that will prevent the #include maze of 2.4, which resulted in
> everything being rebuilt just because one header file was touched.

Ok, how about this:

for each header file {
make header.o
1) if it doesn't build {
print out a warning
continue
}
for each #include line {
remove the #include line
make header.o
2) if it build {
print out a warning
}
3) if there are less than x gcc warnings {
print out a warning
}
}
}

1) is my old proposal. 2) is the natural counterpart. 3) could be
what you want. If some header is only needed for something like your
example, we may be able to catch it this way.

Would this work? Would something else work even better?

Jörn

--
Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.
-- M.A. Jackson
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/