"Devrobcom" <> wrote:
# Hi
# I know that this is not the Lint forum, but I get some Lint warnings
# when setting my pointers to NULL. And the problem is
# I don't know howto cast a function ptr the right way.
#
# typedef int FP(char*, char*);
#
# FP *pfp;
# pfp = NULL; --error 64: (Error -- Type mismatch (assignment) (ptrs to
# void/nonvoid))
#
# I have tried, without success:
# pft = (FP*)NULL;
# pfp = (int(*)(char*, char*))NULL;
I don't use NULL, I just use 0.
cat <<':eof' >/tmp/t.c
void f(void) {
typedef int FP(char*, char*);
FP *pfp;
pfp = 0;
}
:eof
cc -c /tmp/t.c
--
Derk Gwen
http://derkgwen.250free.com/html/index.html
I hope it feels so good to be right. There's nothing more
exhilirating pointing out the shortcomings of others, is there?