On Wed, 3 Aug 2005, Mitesh Shah wrote:
>
> - 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.
Actually, having thought about this some more, I think I'll just parse the
initial preprocessing tokens into global scope. That way I can do it just
once at the top, and every file will automatically see it.
It will cause a fairly strange situation where an #undef of such a
pre-declared token in one file will actually cause that pre-define
preprocessor token to disappear from subsequent files too. That's ugly,
and I'll see if I can fix it, but the advantages are legion.
In particular, your "close()" wasn't the right fix: we'd have to do an
"lseek(include_fd, 0, SEEK_SET)" or something instead, and that has other
problems (like not allowing -include of something ephemeral, which sounds
like a better feature anyway).
I may have to revisit this thing, we'll see.
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