Source code :
char firstchar1(char *s)
{
return *s;
}
char firstchar2(char *s)
{
if(s==NULL)
return *s;
else
return '0';
}
while running splint as
./splint +null func.c or
./splint func.c
both time output of splint is same and output is:
Splint 3.1.1 --- 28 Apr 2003
Finished checking --- no warnings
-----
splint must show warning msg : Dereferencing possibly null pointer.