I updated dated my workstation today which included pulling in gcc 4.0.1 and thought I'd give mod_python a whirl and how if they'd play together.

Compilation fails with the following:

requestobject.c: In function 'request_tp_dealloc':
requestobject.c:1482: warning: implicit declaration of function 'request_tp_clear'
requestobject.c: At top level:
requestobject.c:1514: error: static declaration of 'request_tp_clear' follows non-static declaration requestobject.c:1482: error: previous implicit declaration of 'request_tp_clear' was here
requestobject.c: In function 'request_tp_clear':
requestobject.c:1528: warning: assignment from incompatible pointer type
apxs:Error: Command failed with rc=65536

Since gcc 3.3 sails right through, I'm going to assume gcc 4 is stricter. It's easy enough to fix (and I will) by adding a function prototype for request_tp_clear before it is called in request_tp_dealloc(). eg.
 static int request_tp_clear(requestobject *self);

I've noticed that in general functions are implicitly declared in mod_python. Is there a technical reason for this, or is it "just one of those things"?

Also, since request_tp_clear is only used in requestobject.c, is it correct to put the declaration there or should it go in requestobject.h? Ya, I know, my c-skills suck. :)

Regards,
Jim

Reply via email to