INN commit: trunk/innfeed (imap_connection.c)

INN Commit rra at isc.org
Tue Sep 20 20:45:22 UTC 2011


    Date: Tuesday, September 20, 2011 @ 13:45:22
  Author: iulius
Revision: 9381

fix gcc warning with new Cyrus SASL version

Cyrus SASL 2.1.25 modified the prototype of SASL callback functions
to fix the "function declaration isn't a prototype" warning.

<sasl/saslplug.h>:
@@ -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);


When using callbacks, we now cast the argument:
    (sasl_callback_ft) &getsimple
to silent "initialization from incompatible pointer type" warnings,
and define sasl_callback_ft for older Cyrus SASL versions.

Modified:
  trunk/innfeed/imap_connection.c

-------------------+
 imap_connection.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Modified: imap_connection.c
===================================================================
--- imap_connection.c	2011-09-19 21:05:01 UTC (rev 9380)
+++ imap_connection.c	2011-09-20 20:45:22 UTC (rev 9381)
@@ -47,7 +47,12 @@
 
 #ifdef HAVE_SASL
 # include <sasl/sasl.h>
+# include <sasl/saslplug.h>
 # include <sasl/saslutil.h>
+/* For Cyrus SASL versions < 2.1.24. */
+# ifndef sasl_callback_ft
+typedef int (*sasl_callback_ft)(void);
+# endif
 #endif
 
 #ifndef MAXHOSTNAMELEN
@@ -1287,13 +1292,13 @@
 /* callbacks we support */
 static sasl_callback_t saslcallbacks[] = {
   {
-    SASL_CB_GETREALM, &getsimple, NULL
+    SASL_CB_GETREALM, (sasl_callback_ft) &getsimple, NULL
   }, {
-    SASL_CB_USER, &getsimple, NULL
+    SASL_CB_USER, (sasl_callback_ft) &getsimple, NULL
   }, {
-    SASL_CB_AUTHNAME, &getsimple, NULL
+    SASL_CB_AUTHNAME, (sasl_callback_ft) &getsimple, NULL
   }, {
-    SASL_CB_PASS, &getsecret, NULL
+    SASL_CB_PASS, (sasl_callback_ft) &getsecret, NULL
   }, {
     SASL_CB_LIST_END, NULL, NULL
   }




More information about the inn-committers mailing list