[Pyrex] const in function type signature

Dominic Sacré dominic.sacre at gmx.de
Thu Dec 25 12:09:18 CET 2008


Hi,

I'm using Pyrex to wrap a C library that uses callbacks. Some of the 
parameters to the callback functions are const, e.g.
void(*callback)(int num, const char *msg, const char *where)

Pyrex doesn't allow const, so i have to write this as
void(*callback)(int num, char *msg, char *where)

This works, as long as the function doesn't actually try to modify its 
arguments, but passing the function pointer to the library produces 
warnings like:
passing argument 2 of ‘lo_server_new’ from incompatible pointer type

Is there some way to get rid of these warnings? Basically, just allowing the 
use of const in the Pyrex source, and literally placing it in the generated 
C code would suffice...


Thanks,

Dominic



More information about the Pyrex mailing list