Dan Carpenter wrote: > On 10/5/06, Michael Stefaniuc <mstefani@xxxxxxxxxx> wrote: >> Dan Carpenter wrote: >> > Work on smatch is going ahead. I have one real life check is working >> > and I've added a patched up the core code quite a bit. >> great work! What about the old smatch.pm and perl scripts? Will i be >> still able to use those or would i have to port them over? I'm still >> using the old smatch on checking Wine. > > They'll have to be ported I'm afraid. That's not realy a problem especialy as i can keep using the old smatch for a while. > Rewrites are a pain, but it's worth it because now it's easier to > install, it's easier to use, and it runs a bajillion times faster. I'm more concerned about how easy it is to write new "scripts" or modify existing ones. For Wine I use only unreached-code.pl as is. Due to the Win32 API i had to modify unfree.pl quite a bit. > Using sparse also buys us a bunch of features for free, for example if > you have 'i' defined in two different scopes with sparse handles that. > Another example is compound conditions. The old code was confused by > stuff like: > if (a && a->foo() || a && a->bar()) > there wasn't a good way to deal with that with the old way. > > Which checks do you use most? I'll port those first... The scripts used regularly for Wine are on http://people.redhat.com/mstefani/wine/smatch/scripts.html. Except that i use only unreached-code.pl from the original smatch scripts. Though not all scripts are that usefull; i probably could throw out immediately while_for_check.pl and crosscalls_WtoA.pl. Most successfull script is redundant_null_check.pl (finds "if (bla) free(bla);") as i had only 2 false positives until now. unfree-wine.pl is the adaptation+bug fixes of the original unfree.pl (usefull but lots of false positives). The other usefull script is wine_locks.pl that found quite a few missing unlocks on error paths. And i have some other ideas about a couple of usefull smatch scripts for Wine but lack the time to implement them. So most usefull would be a short documentation how to port things. Maybe a short mapping between the most importand smatch.pm functions and their C counter part would be enough for the start. I looked at the smatch sparse diff and it didn't look that complicated to use. I have anyway a longish train ride next week so i will give it a try; maybe with an easy and dumb version of redundant_null_check.pl bye michael -- Michael Stefaniuc Tel.: +49-711-96437-199 Sr. Network Engineer Fax.: +49-711-96437-111 Red Hat GmbH Email: mstefani@xxxxxxxxxx Hauptstaetterstr. 58 http://www.redhat.de/ D-70178 Stuttgart - 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