clang static analyze notes

This commit is contained in:
John Cupitt 2013-11-22 11:27:29 +00:00
parent 36f2f630d7
commit 2f602eedd6
3 changed files with 35 additions and 31 deletions

View File

@ -54,6 +54,11 @@ Clang build:
$ CC=clang CXX=clang++ ./configure --prefix=/home/john/vips
Clang static analysis:
$ CC=... scan-build ./configure ...
$ scan-build -o scan -v make
Clang dynamic analysis:
$ CC=clang CXX=clang++ LD=clang \
@ -68,13 +73,6 @@ Clang dynamic analysis:
LDFLAGS="-fsanitize=thread -pie" \
./configure --prefix=/home/john/vips --disable-introspection
Clang static analysis:
$ configure as you please
$ scan-build -o scan make ...
# Dependencies
libvips has to have gettext, glib-2.x and libxml-2.0. The build system needs

View File

@ -132,11 +132,13 @@ char *name;
/* Find the x position of a file name (extract n from <root>.nxm.v).
*/
static int
find_x( name )
char *name;
{ int n;
find_x( char *name )
{
int n;
char *p;
char *out = strdup( name );
char *out;
out = strdup( name );
/* Chop off '.v'.
*/
@ -166,17 +168,21 @@ char *name;
return( -1 );
}
free( out );
return( n );
}
/* Find the y position of a file name (extract m from <root>.nxm.v).
*/
static int
find_y( name )
char *name;
{ int m;
find_y( char *name )
{
int m;
char *p;
char *out = strdup( name );
char *out;
out = strdup( name );
/* Chop off '.v'.
*/
@ -207,12 +213,10 @@ char *name;
}
free( out );
return( m );
}
static int
mosaic_analysis(int width, int height,IMAGE **inp, IMAGE *out,
int xoff, int yoff, int *vxdisp, int *vydisp,int *hxdisp, int *hydisp) {

View File

@ -258,11 +258,13 @@ char *name;
/* Find the x position of a file name (extract n from <root>.nxm.v).
*/
static int
find_x( name )
char *name;
{ int n;
find_x( char *name )
{
int n;
char *p;
char *out = strdup( name );
char *out;
out = strdup( name );
/* Chop off '.v'.
*/
@ -292,17 +294,21 @@ char *name;
return( -1 );
}
free( out );
return( n );
}
/* Find the y position of a file name (extract m from <root>.nxm.v).
*/
static int
find_y( name )
char *name;
{ int m;
find_y( char *name )
{
int m;
char *p;
char *out = strdup( name );
char *out;
out = strdup( name );
/* Chop off '.v'.
*/
@ -333,14 +339,10 @@ char *name;
}
free( out );
return( m );
}
/* Join two frames left-right. Have to open them and find their sizes.
*/
static int