Casting function pointers to sasl_callback_ft

Ted Yu yuzhihong at gmail.com
Mon Mar 6 13:28:38 EST 2017


Hi,
I am writing C++ code which calls sasl_client_init(). I defined plugin
functions such as:

int GetPluginPath(void *context,
  const char **path) {

However, the compiler (C++11) doesn't allow me to assign function pointer
to proc member of sasl_callback_t :

connection/connection-factory.cc:164:22: error: reinterpret_cast from 'int
(SaslHandler::*)(void *, int, const char )' to 'sasl_callback_ft' (aka 'int
()()') is not allowed

  callback->proc = reinterpret_cast<sasl_callback_ft>
(&SaslHandler::SaslLogFn);

Has anyone seen the above error ?

If so, how did you get past it ?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/cyrus-sasl/attachments/20170306/c7dea32a/attachment-0001.html>


More information about the Cyrus-sasl mailing list