B
Brian
I am new to lint and have been experimenting with splint. An
initialization problem I was caught on recently was not found by
splint. Would pc-lint catch this problem:
/* test program for splint */
/* body of func1 commented out to recreate lack of initialization */
static int x[3];
void func1( void);
int func2(void);
void func3(int *);
void func1( void)
{
/* when commented out,
x[0]= 0;
x[1]= 1;
x[2]= 2;
x[] is not initialized */
}
int func2(void)
{
int y;
func3(&x[0]);
y= x[0] + x[1] + x[2];
return y;
}
void func3(int * u)
{
/* some filter code */
u[2]= u[1];
u[1]= u[0];
}
Splint 3.1.1 --- 12 April 2003
Finished checking --- no warnings
Thanks,
initialization problem I was caught on recently was not found by
splint. Would pc-lint catch this problem:
/* test program for splint */
/* body of func1 commented out to recreate lack of initialization */
static int x[3];
void func1( void);
int func2(void);
void func3(int *);
void func1( void)
{
/* when commented out,
x[0]= 0;
x[1]= 1;
x[2]= 2;
x[] is not initialized */
}
int func2(void)
{
int y;
func3(&x[0]);
y= x[0] + x[1] + x[2];
return y;
}
void func3(int * u)
{
/* some filter code */
u[2]= u[1];
u[1]= u[0];
}
Splint 3.1.1 --- 12 April 2003
Finished checking --- no warnings
Thanks,