smatch v1.60 released

From: Dan Carpenter
Date: Mon Jan 12 2015 - 06:45:33 EST


Intro:

Smatch is a C static checker with a lot of kernel specific checks. You
can download it from: http://repo.or.cz/w/smatch.git.

Notes:

It has been a year and a half since the last release so there have been
a lot of changes everywhere. The main thing continues to be tracking
values across function calls.

One warning I'm particularly proud of resulted in this patch:
https://lkml.org/lkml/2015/1/6/1034
To make that work, then Smatch traced the data down three normal
calls and across a function pointer call and returned that one of the
function pointers didn't initialize *count. Smatch is the only open
source project trying to do this level of cross function analysis.

The cross function database is so useful on it's own if you are trying
to understand a new subsystem. Just build the database and then you
can run `smdb.py function_name` to see how it's called and which values
are passed. Maybe it's called as a function pointer so using grep and
cscope doesn't work. Or maybe you wanted to see where the family in
(struct net_proto_family)->family is set you could run
`smdb.py where net_proto_family family`.

Quickstart Guide:

The command to set up the database is:
~/path/to/smatch/smatch_scripts/build_kernel_data.sh
This command takes 2-3 hours to complete. You can skip this step if you
want.

To run smatch on the kernel source:
~/path/to/smatch/smatch_scripts/test_kernel.sh
This creates a warns.txt file with the warnings.

To test a specific file:
~/path/to/smatch/smatch_scripts/kchecker drivers/file.c

regards,
dan carpenter
--
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/