compiler warning on freebsd
Julien ÉLIE
julien at trigofacile.com
Thu Sep 15 14:47:45 EDT 2011
Hi Alexey,
> This is not Cyrus SASL code, right?
Yes, you're right. It is the implementation of the AUTHINFO SASL
extension in INN.
> If that is the case, you would need
> to update it to typecast pointers to functions.
> saslplug.h defines:
>
> typedef int (*sasl_callback_ft)(void);
>
>> caused by the second arguments of:
>>
>> /* callbacks we support */
>> static sasl_callback_t saslcallbacks[] = {
>> {
>> SASL_CB_GETREALM, &getsimple, NULL
>
> This needs to become something like:
>
> SASL_CB_GETREALM, (sasl_callback_ft) &getsimple, NULL
It works but... only with new Cyrus SASL 2.1.25.
If I compile it with the previous 2.1.24 version, it breaks:
error: 'sasl_callback_ft' undeclared here (not in a function)
I do not clearly see in the changelog of 2.1.25 that new types should
be used.
A diff between 2.1.24 and 2.1.25 clearly shows that sasl_callback_ft
is new in 2.1.25:
@@ -33,9 +33,10 @@
* SASL_FAIL -- unable to find a callback of the requested type
* SASL_INTERACT -- caller must use interaction to get data
*/
+typedef int (*sasl_callback_ft)(void);
typedef int sasl_getcallback_t(sasl_conn_t *conn,
unsigned long callbackid,
- int (**pproc)(),
+ sasl_callback_ft * pproc,
void **pcontext);
Why such a change?
If a user upgrades Cyrus SASL on his machine, it will trigger this error.
Besides, adding in INN a special "#ifdef sasl_callback_ft" is not very
attractive.
--
Julien ÉLIE
« Le chemin le plus court d'un point à un autre est la ligne droite,
à condition que les deux points soient bien en face l'un de
l'autre. » (Pierre Dac)
More information about the Cyrus-sasl
mailing list