On Wed, 10 Mar 2021 21:55:43 +0100, Christian Göttsche <[email protected]>
wrote:
> Am Mi., 10. März 2021 um 21:44 Uhr schrieb Wietse Venema
> <[email protected]>:
> >
> > Christian G?ttsche:
> > > -g -O2 -I. -I../../include -DLINUX4 -c xsasl_cyrus_server.c
> > > xsasl_cyrus_server.c:185:26: warning: initialization of ?int
> > > (*)(void)? from incompatible pointer type ?int (*)(void *, char **)?
> > > [-Wincompatible-pointer-types]
> > > 185 | {SASL_CB_GETCONFPATH,&xsasl_getconfpath, 0},
> > > | ^
> >
> > I have:
> >
> > 182 static sasl_callback_t callbacks[] = {
> > 183 {SASL_CB_LOG, (XSASL_CYRUS_CB) &xsasl_cyrus_log,
> > NO_CALLBACK_CONTEXT},
> > 184 {SASL_CB_LIST_END, 0, 0}
> > 185 };
> >
> > Your code is different.
> >
> > > xsasl_cyrus_client.c: In function ?xsasl_cyrus_client_init?:
> > > xsasl_cyrus_client.c:233:23: warning: initialization of ?int
> > > (*)(void)? from incompatible pointer type ?int (*)(void *, char **)?
> > > [-Wincompatible-pointer-types]
> > > 233 | {SASL_CB_GETCONFPATH,&xsasl_getconfpath, 0},
> > > | ^
> >
> > I have:
> >
> > 230 static sasl_callback_t callbacks[] = {
> > 231 {SASL_CB_LOG, (XSASL_CYRUS_CB) &xsasl_cyrus_log, 0},
> > 232 {SASL_CB_LIST_END, 0, 0}
> > 233 };
> >
> > Please complain to the maintainer of your distro.
> >
>
> Seems to be a caused by a flawed Debian patch:
> https://salsa.debian.org/postfix-team/postfix-dev/-/blob/debian/master/debian/patches/07_sasl_config.diff
Yes, I spotted this warning too when rebuilding the package with my
tentative fix.
This part is indeed a Debian patch, but the part involved (but not at
fault, in my current understanding) in the crash is AFAICS from vanilla
postfix, and in a different callback list.
But this is moot either way, as the SASL structure definition prevents
the compiler from giving any helpful warning/error by defining the
callback type as:
libsasl2-dev 2.1.27+dfsg-2.1: /usr/include/sasl/sasl.h
typedef struct sasl_callback {
/* Identifies the type of the callback function.
* Mechanisms must ignore callbacks with id's they don't recognize.
*/
unsigned long id;
int (*proc)(void); /* Callback function. Types of arguments vary by 'id'
*/
void *context;
} sasl_callback_t;
So any callback "proc" member has to be explicitly cast as any
parameter at all will trigger a warning. Which seems an unfortunate
decision to my very limited C experience, but is not postfix'
responsibility.
Regards,
--
Vincent Pelletier
GPG fingerprint 983A E8B7 3B91 1598 7A92 3845 CAC9 3691 4257 B0C1