Re: compiler warning on freebsd

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

 



Julien ÉLIE wrote:

Hi Alexey,
Hi Julien,

No problem if I do not use the "strict-prototypes" warning with GCC.

Line 353 is:
int (*proc)();
in sasl_callback_t definition.
I might have fixes for these in my private fork. I will try to apply
them to the HEAD.
Oh, that's great! Many thanks.
We're using Cyrus SASL for the AUTHINFO SASL extension of the news server INN.
This is on the trunk now.

I have just tried to build Cyrus SASL 2.1.25 but it still does not work.
I see that line 353 is now:
   int (*proc)(void);


I now have the following failures with GCC 4.6.1 (on x86_64 GNU/Linux):


imap_connection.c:1290: error: initialization from incompatible pointer type
imap_connection.c:1292: error: initialization from incompatible pointer type
imap_connection.c:1294: error: initialization from incompatible pointer type
imap_connection.c:1296: error: initialization from incompatible pointer type
make[2]: *** [imap_connection.o] Error 1
This is not Cyrus SASL code, right? 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

 }, {
   SASL_CB_USER, &getsimple, NULL
 }, {
   SASL_CB_AUTHNAME, &getsimple, NULL
 }, {
   SASL_CB_PASS, &getsecret, NULL
 }, {
   SASL_CB_LIST_END, NULL, NULL
 }
};

etc.

where prototype of the first function is:

static int getsimple(void *context UNUSED,
                    int id,
                    const char **result,
                    unsigned *len)






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

  Powered by Linux