http://www.kernel.org/pub/software/devel/sparse/dist/
git clone git://git.kernel.org/pub/scm/devel/sparse/sparse.git
http://www.codemonkey.org.uk/projects/git-snapshots/sparse/
make
make install
#include <stdio.h>
int main()
{
printf ("hello world\n");
return 0;
}
[beyes@SLinux sparse]$ ./sparse /home/beyes/C/gcc/context.c
/home/beyes/C/gcc/context.c:6:10: warning: non-ANSI function declaration of function 'main'
main(int argc, char **argv)
#include <stdio.h>
#define __acquire(x) __context__(x,1)
#define __release(x) __context__(x,-1)
int main(int argc, char **argv)
{
__acquire(10);
printf ("hello world\n");
return 0;
}
[beyes@SLinux sparse]$ ./sparse /home/beyes/C/gcc/context.c
/home/beyes/C/gcc/context.c:6:5: warning: context imbalance in 'main' - wrong count at exit
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |