[zeromq-dev] czmq pendantic test error

Arnaud Loonstra arnaud at sphaero.org
Tue Oct 29 11:00:20 CET 2019


Anybody ideas how to get around errors like these when using function 
pointers in zhash?

src/sphactor.c: In function 'sphactor_new_by_type':

src/sphactor.c:71:36: error: ISO C forbids conversion of object pointer 
to function pointer type [-Werror=pedantic]

      sphactor_handler_fn *handler = (sphactor_handler_fn *) 
zhash_lookup( actors_reg, actor_type);

I know pedantic is a bit extreme but I'm curious what would work. I'm 
registering handlers by a name in a zhash:

https://github.com/sphaero/libsphactor/blob/8f6cc11fb1f1cb513175a091e7fc437de7219752/src/sphactor.c#L265 


Apparently this is not allowed strictly speaking.

Rg,

Arnaud



More information about the zeromq-dev mailing list