Re: compiler warning on freebsd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Julien ÉLIE wrote:

Hi Alexey,
Hi Julien,

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.
It doesn't have to be. You can typecast to the proper type yourself.

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?
Well, you complained about other errors I thought I push some of my own changes to fix it.

If a user upgrades Cyrus SASL on his machine, it will trigger this error.
It is a warning on most systems.

Besides, adding in INN a special "#ifdef sasl_callback_ft" is not very
attractive.
I can add something like
#define SASL_CALLBACK_FT_DEFINED

which you can test to see if the new typedef is available. This will be included in 2.1.26 and later versions.
Would this help?





[Index of Archives]     [Info Cyrus]     [Squirrel Mail]     [Linux Media]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux