SourceForge Logo Smatch Logo

Smatch!!!

Smatch -- The Source Matcher, brought to you by the good folks at KernelJanitors.

Smatch has been completely rewritten in C and now uses sparse as a C parser instead of gcc as a C parser. The new URL is http://repo.or.cz/w/smatch.git.

Here are the new instructions:

	git clone git://repo.or.cz/smatch.git
        cd smatch
        make
        cd ~/your/code/
        make clean
        make CHECK="~/path/to/smatch/smatch --full-path" \
                CC=~/path/to/smatch/cgcc | tee warns.txt
Except if you are using smatch against the kernel the command is:
        make CHECK="~/path/to/smatch/smatch -p=kernel" C=1 \
                bzImage modules | tee warns.txt

2.3.37 and after: Please set "CONFIG_DYNAMIC_DEBUG=n". That feature uses declared label things that mess up Smatch's flow analysis.

If you are using smatch on a different project then the most important thing is to build the list of functions which don't return. Do the first build using the --info parameter and use smatch_scripts/gen_no_return_funcs.sh to create this list. Save the resulting file under smatch_data/(your project).no_return_funcs and use -p=(your project) for the next smatch run.

If you are using smatch to test wine then use "-p=wine" to turn on the wine specific checks.

SourceForge Project Page

Email the developers at smatch [at] vger.kernel.org