Building INN / Cyrus SASL with GCC 8.1

Julien ÉLIE julien at trigofacile.com
Thu May 3 16:38:06 EDT 2018


Hi Ken,

Maybe it is still time for inclusion in the forthcoming release.
Building the INN news server with GCC 8.1 gives the following warning:

imap_connection.c:1296:23: error: cast between incompatible function 
types from ‘int (*)(void *, int,  const char **, unsigned int *)’ to 
‘int (*)(void)’ [-Werror=cast-function-type]
      SASL_CB_GETREALM, (sasl_callback_ft) &getsimple, NULL



static sasl_callback_t saslcallbacks[] = {
   {
     SASL_CB_GETREALM, (sasl_callback_ft) &getsimple, NULL
   }, {
     SASL_CB_USER, (sasl_callback_ft) &getsimple, NULL
   }, {
     SASL_CB_AUTHNAME, (sasl_callback_ft) &getsimple, NULL
   }, {
     SASL_CB_PASS, (sasl_callback_ft) &getsecret, NULL
   }, {
     SASL_CB_LIST_END, NULL, NULL
   }
};


saslplug.h currently defines:
   typedef int (*sasl_callback_ft)(void);



But if I change it to:
   typedef void (*sasl_callback_ft)(void);
I have another warning:
imap_connection.c:1297:23: error: initialization of ‘int (*)(void)’ from 
incompatible pointer type ‘void (*)(void)’ 
[-Werror=incompatible-pointer-types]

Same thing with:
   typedef void (*sasl_callback_ft)(void *, int,  const char **, 
unsigned int *);
that gives:
imap_connection.c:1297:23: error: initialization of ‘int (*)(void)’ from 
incompatible pointer type ‘int (*)(void *, int,  const char **, unsigned 
int *)’ [-Werror=incompatible-pointer-types]




Do you have a clue for how to fix it?
It will probably need a change to the typedef in saslplug.h.

-- 
Julien ÉLIE

« C'est la goutte d'eau qui fait déborder le vase et qui met le feu
   aux poudres. »


More information about the Cyrus-sasl mailing list