autofs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] autofs-5.1.9 - cast sasl_callback_t function pointers
@ 2024-03-21  1:39 David Disseldorp
  2024-04-16 14:27 ` David Disseldorp
  0 siblings, 1 reply; 2+ messages in thread
From: David Disseldorp @ 2024-03-21  1:39 UTC (permalink / raw)
  To: autofs; +Cc: David Disseldorp

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@suse.de>
---
 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 },
 };
 
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] autofs-5.1.9 - cast sasl_callback_t function pointers
  2024-03-21  1:39 [PATCH] autofs-5.1.9 - cast sasl_callback_t function pointers David Disseldorp
@ 2024-04-16 14:27 ` David Disseldorp
  0 siblings, 0 replies; 2+ messages in thread
From: David Disseldorp @ 2024-04-16 14:27 UTC (permalink / raw)
  To: autofs

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@suse.de>
> ---
>  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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-16 14:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-21  1:39 [PATCH] autofs-5.1.9 - cast sasl_callback_t function pointers David Disseldorp
2024-04-16 14:27 ` David Disseldorp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).