From: Viktor Szakats Date: Thu, 4 Sep 2025 09:58:02 +0000 (+0200) Subject: openldap: fix `-Wtentative-definition-compat` X-Git-Tag: curl-8_16_0~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b85cb8cb4e143d1615d4fcc1ce8f2f7b66453995;p=thirdparty%2Fcurl.git openldap: fix `-Wtentative-definition-compat` It's a `-Weverything` warning that appeared in llvm/clang 21. ``` lib/openldap.c:1297:19: warning: duplicate declaration of 'ldapsb_tls' is invalid in C++ [-Wtentative-definition-compat] 1297 | static Sockbuf_IO ldapsb_tls = | ^ lib/openldap.c:499:19: note: previous declaration is here 499 | static Sockbuf_IO ldapsb_tls; | ^ ``` Reported-by: correctmost on github Fixes #18470 Cherry-picked from #18477 Closes #18485 --- diff --git a/lib/openldap.c b/lib/openldap.c index 1b32e12b68..da26d4a78d 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -496,7 +496,24 @@ static CURLcode oldap_perform_sasl(struct Curl_easy *data) } #ifdef USE_SSL -static Sockbuf_IO ldapsb_tls; +static int ldapsb_tls_setup(Sockbuf_IO_Desc *sbiod, void *arg); +static int ldapsb_tls_remove(Sockbuf_IO_Desc *sbiod); +static int ldapsb_tls_ctrl(Sockbuf_IO_Desc *sbiod, int opt, void *arg); +static ber_slen_t ldapsb_tls_read(Sockbuf_IO_Desc *sbiod, void *buf, + ber_len_t len); +static ber_slen_t ldapsb_tls_write(Sockbuf_IO_Desc *sbiod, void *buf, + ber_len_t len); +static int ldapsb_tls_close(Sockbuf_IO_Desc *sbiod); + +static Sockbuf_IO ldapsb_tls = +{ + ldapsb_tls_setup, + ldapsb_tls_remove, + ldapsb_tls_ctrl, + ldapsb_tls_read, + ldapsb_tls_write, + ldapsb_tls_close +}; static bool ssl_installed(struct connectdata *conn) { @@ -1293,16 +1310,6 @@ ldapsb_tls_write(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len) } return ret; } - -static Sockbuf_IO ldapsb_tls = -{ - ldapsb_tls_setup, - ldapsb_tls_remove, - ldapsb_tls_ctrl, - ldapsb_tls_read, - ldapsb_tls_write, - ldapsb_tls_close -}; #endif /* USE_SSL */ #endif /* !CURL_DISABLE_LDAP && USE_OPENLDAP */