Re: [PATCH] autofs-5.1.9 - cast sasl_callback_t function pointers

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

 



Hi,

On Thu, 21 Mar 2024 12:39:47 +1100, David Disseldorp wrote:

> GCC 14+ uses -Werror=incompatible-pointer-types by default.
> sasl.h:sasl_callback_t doesn't offer a type-safe mechanism for setting
> @proc callback functions, so a cast is necessary.
> 
> Signed-off-by: David Disseldorp <ddiss@xxxxxxx>
> ---
>  modules/cyrus-sasl.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/modules/cyrus-sasl.c b/modules/cyrus-sasl.c
> index e742eaf..107e182 100644
> --- a/modules/cyrus-sasl.c
> +++ b/modules/cyrus-sasl.c
> @@ -109,17 +109,17 @@ static int getpass_func(sasl_conn_t *, void *, int, sasl_secret_t **);
>  static int getuser_func(void *, int, const char **, unsigned *);
>  
>  static sasl_callback_t callbacks[] = {
> -	{ SASL_CB_USER, &getuser_func, NULL },
> -	{ SASL_CB_AUTHNAME, &getuser_func, NULL },
> -	{ SASL_CB_PASS, &getpass_func, NULL },
> +	{ SASL_CB_USER, (int (*)(void))&getuser_func, NULL },
> +	{ SASL_CB_AUTHNAME, (int (*)(void))&getuser_func, NULL },
> +	{ SASL_CB_PASS, (int (*)(void))&getpass_func, NULL },
>  	{ SASL_CB_LIST_END, NULL, NULL },
>  };
>  
>  static sasl_callback_t debug_callbacks[] = {
> -	{ SASL_CB_LOG, &sasl_log_func, NULL },
> -	{ SASL_CB_USER, &getuser_func, NULL },
> -	{ SASL_CB_AUTHNAME, &getuser_func, NULL },
> -	{ SASL_CB_PASS, &getpass_func, NULL },
> +	{ SASL_CB_LOG, (int (*)(void))&sasl_log_func, NULL },
> +	{ SASL_CB_USER, (int (*)(void))&getuser_func, NULL },
> +	{ SASL_CB_AUTHNAME, (int (*)(void))&getuser_func, NULL },
> +	{ SASL_CB_PASS, (int (*)(void))&getpass_func, NULL },
>  	{ SASL_CB_LIST_END, NULL, NULL },
>  };
>  

Does anyone have feedback on this proposed change?




[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux