function pointer is not initializing to NULL

Tue Apr 15 11:03:00 GMT 2008


I'm using AIX 5.1 and gcc 4.0 version to build my software. Here I'm finding
some problem in runtime.
Here we have static function pointer that is initialized to NULL. Here is
the below cases...

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

sampleFunc() {

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

Here at run time for the first only directly its coming to this if loop (ie.
!=NULL case), and causing problem.
But if I remove the NULL initialization, its working fine. I think 'static'
will initialize. But why this is not initializing if I explicitly do? Is
this problem with AIX environment or gcc? Thanks for any suggestion!

Thanks & Regards,
View this message in context:
Sent from the gcc - Help mailing list archive at

More information about the Gcc-help mailing list