On Tue, 2 Aug 2005, Linus Torvalds wrote:
>
> I should make types always have "file scope", but I'm leaving it for now.
> I think it's actually very close to working apart from that issue.
Just to give you an idea of what it does:
[EMAIL PROTECTED] sparse]$ cat -n test.c
1 void f(unsigned int arg)
2 {
3 }
[EMAIL PROTECTED] sparse]$ cat -n test.c
1 void f(unsigned int arg)
2 {
3 }
[EMAIL PROTECTED] sparse]$ ./check test.c test2.c
test.c:1:6: warning: symbol 'f' was not declared. Should it be static?
test.c:1:6: warning: symbol 'f' was not declared. Should it be static?
test2.c:1:6: warning: symbol 'f' redeclared with different type
(originally declared at test.c:1) - incompatible argument 1 (different types)
ie when you check two source-files together, it actually will end up
noticing any global conflicts even in the absense of declarations.
However, the bug right now is that because it does struct namespaces etc
globally too, you also get totally invalid warnings like this:
[EMAIL PROTECTED] sparse]$ cat -n test.c
1 struct a {
2 char b;
3 };
[EMAIL PROTECTED] sparse]$ cat -n test2.c
1 struct a {
2 int a;
3 };
[EMAIL PROTECTED] sparse]$ ./check test.c test2.c
test2.c:1:10: error: redefinition of struct a
heh. I'll fix it eventually. It looks pretty cool otherwise.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html