kernel32/tests: do not compare handle with zero directly (Smatch)

Dan Carpenter error27 at gmail.com
Wed Jan 20 04:47:18 CST 2010


On Tue, Jan 19, 2010 at 03:01:20PM +0300, Dan Carpenter wrote:
> On 1/19/10, Dan Carpenter <error27 at gmail.com> wrote:
> 
> > There is a wine_checker.sh script in smatch_scripts so you can quickly test
> > individual files.  I just pushed a change to make wine_checker.sh find the
> > smatch binary so you may want to pull the most recent changes.
> >
> > /path/to/smatch_scripts/wine_checker.sh dlls/kernel32/tests/virtual.c
> 
> Also if you want to run the new smatch against the entire source you
> can use the following compile.sh script:
> 
> #!/bin/bash
> 
> IFS=
> if echo $* | grep -q '\.c$' ; then
>         ~/progs/smatch/devel/smatch -p=wine --full-path -D__i386__ $*
> fi
> gcc $*
> 
> ############ End of compile.sh script ##############
> 
> Save that as compile.sh and use the following command to build.
> 
> make CC=~/progs/wine/compile.sh 2>&1 | tee warns.txt
> 
> Sorry, this was undocumented and complicated.  The cgcc that comes
> with smatch is supposed to be used instead of the compile.sh but it
> doesn't work for me.  I will investigate why.
> 

cgcc was fixed upstream in sparse.  I have applied the change so you 
don't need to create a compile.sh any more.  Here is the command to
use:

make CHECK="~/progs/smatch/devel/smatch -p=wine --full-path" \
    CC=~/progs/smatch/devel/cgcc 2>&1 | tee warns.txt

According to LKML if your tool takes longer than two minutes setup then
no one will use it.  Here are the full commands to go from zero to useful.

git clone git://repo.or.cz/smatch.git
cd smatch
make
cd ~/progs/wine/devel
make clean
make CHECK="~/progs/smatch/devel/smatch -p=wine --full-path" \
    CC=~/progs/smatch/devel/cgcc 2>&1 | tee warns.txt

regards,
dan carpenter



More information about the wine-devel mailing list