On Wed, 3 Aug 2005, Mitesh Shah wrote:
>
> This looks great, Thanks.
Well, it doesn't actually _work_ yet. It kind of does, but there's some
stuff that is broken due to what I think is incorrect scoping. My trivial
examples have worked ok, but some more involved stuff with a kernel sparse
run with things like "sparse ... fs/*.c" doesn't.
So there are bugs still. I fixed the "global type" problem, but others
remain.
> Couple of things:
>
> - If you specify an include file using "-include" option, sparse opens it in
> handle_switch_i() but does not close it cleanly so for the next time the
> read does not return anything but EOF. I think we should close the fd in
> sparse_file once the tokenize is done. So here is the diff that I am
> suggesting.
Looks good, will do.
> - Now how do I get the symbol_list per file after sparsing? Just checking
> the scope enough? For example, if I want to generate intermediate files per
> source file.
Yes, you can check the "symbol->scope", but things with global scope will
be in the global "built-in" scope, so checking scope will only help you
with things that are "static" in one file etc. So it's probably not what
you want.
The thing is, I was somewhat lazy, and I made the "sparse()" function just
return one big list of everything it parsed. That's really not very
helpful, but it meant that I didn't have to change the calling convention
in the users.
I should really pass in a "action" function pointer to "sparse()", and
then call that for each file it parses, or something like that. Or perhaps
return a "list of list of symbols". Or perhaps just make it so that the
caller calls "sparse()" until it returns NULL - and it would do one file
at a time.
So I can do pretty much anything, but because I wanted to keep the
interface changes to "sparse()" callers minimal I did this really cheezy
and not very friendly thing of just appending everything in one messy
thing.
Do you have preferences from the list above?
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