This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: function pointer is not initializing to NULL


static int (*retrivalFunc)(char *attr, char *option, returnCode *codePtr,
char *buf) = NULL;


sampleFunc() {

if (attRetrivalfunc != NULL) {
return(retrivalFunc(attName, dataBuf,codePtr, msg));
}
}

Look closely: you're not testing for retrivalFunc == NULL at all.



Segher



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]