From: Stefan Eissing Date: Tue, 17 Dec 2024 08:45:10 +0000 (+0100) Subject: lib: supress deprecation warnings in apple builds X-Git-Tag: curl-8_12_0~324 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef90ee39e129eb463cf866898a8581250c824761;p=thirdparty%2Fcurl.git lib: supress deprecation warnings in apple builds On apple builds, the gssapi/ldap/securetransport headers deprecate almost everything which leads to a wall of compiler warnings on use in code. Suppress those warning that may hide other warnings/errors. Closes #15763 --- diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 29f22fdfe2..a0ddadb49a 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -45,9 +45,6 @@ permissions: {} # # For Secure Transport, curl implements features that require a target # newer than the 10.8 required by `CFURLCreateDataAndPropertiesFromResource`. -# In this case `-Wno-deprecated-declarations` still comes handy to pacify -# deprecation warnings, though the real solution would be to avoid calling -# that function. env: LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings @@ -118,7 +115,6 @@ jobs: compiler: clang configure: --enable-debug --with-secure-transport --with-libssh2=$(brew --prefix libssh2) macos-version-min: '10.12' # for monotonic timers - cflags: '-Wno-deprecated-declarations' - name: 'SecureTransport libssh2' compiler: gcc-12 configure: --enable-debug --with-secure-transport --with-libssh2=$(brew --prefix libssh2) diff --git a/lib/curl_gssapi.c b/lib/curl_gssapi.c index b7e774cea0..0b383f5066 100644 --- a/lib/curl_gssapi.c +++ b/lib/curl_gssapi.c @@ -40,6 +40,11 @@ #define CURL_ALIGN8 #endif +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gss_OID_desc Curl_spnego_mech_oid CURL_ALIGN8 = { 6, (char *)"\x2b\x06\x01\x05\x05\x02" }; @@ -149,4 +154,8 @@ void Curl_gss_log_error(struct Curl_easy *data, const char *prefix, #endif } +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic pop +#endif + #endif /* HAVE_GSSAPI */ diff --git a/lib/krb5.c b/lib/krb5.c index e310a1b57a..4faa263499 100644 --- a/lib/krb5.c +++ b/lib/krb5.c @@ -63,6 +63,11 @@ #include "curl_memory.h" #include "memdebug.h" +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + static CURLcode ftpsend(struct Curl_easy *data, struct connectdata *conn, const char *cmd) { @@ -924,4 +929,8 @@ Curl_sec_end(struct connectdata *conn) conn->mech = NULL; } +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic pop +#endif + #endif /* HAVE_GSSAPI && !CURL_DISABLE_FTP */ diff --git a/lib/ldap.c b/lib/ldap.c index 2cbdb9c214..2f9c192fe4 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -26,6 +26,11 @@ #if !defined(CURL_DISABLE_LDAP) && !defined(USE_OPENLDAP) +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + /* * Notice that USE_OPENLDAP is only a source code selection switch. When * libcurl is built with USE_OPENLDAP defined the libcurl source code that @@ -1113,4 +1118,9 @@ static void _ldap_free_urldesc(LDAPURLDesc *ludp) free(ludp); } #endif /* !HAVE_LDAP_URL_PARSE */ + +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic pop +#endif + #endif /* !CURL_DISABLE_LDAP && !USE_OPENLDAP */ diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c index f6fd55dcec..776dbdae80 100644 --- a/lib/socks_gssapi.c +++ b/lib/socks_gssapi.c @@ -42,6 +42,11 @@ #include "curl_memory.h" #include "memdebug.h" +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + #define MAX_GSS_LEN 1024 static gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT; @@ -537,4 +542,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf, return CURLE_OK; } +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic pop +#endif + #endif /* HAVE_GSSAPI && !CURL_DISABLE_PROXY */ diff --git a/lib/vauth/krb5_gssapi.c b/lib/vauth/krb5_gssapi.c index e792782838..beaf027297 100644 --- a/lib/vauth/krb5_gssapi.c +++ b/lib/vauth/krb5_gssapi.c @@ -42,6 +42,11 @@ #include "curl_memory.h" #include "memdebug.h" +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + /* * Curl_auth_is_gssapi_supported() * @@ -321,4 +326,8 @@ void Curl_auth_cleanup_gssapi(struct kerberos5data *krb5) } } +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic pop +#endif + #endif /* HAVE_GSSAPI && USE_KERBEROS5 */ diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c index f48d9b7000..55232a8e4a 100644 --- a/lib/vauth/spnego_gssapi.c +++ b/lib/vauth/spnego_gssapi.c @@ -42,6 +42,11 @@ #include "curl_memory.h" #include "memdebug.h" +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + /* * Curl_auth_is_spnego_supported() * @@ -288,4 +293,8 @@ void Curl_auth_cleanup_spnego(struct negotiatedata *nego) nego->havemultiplerequests = FALSE; } +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic pop +#endif + #endif /* HAVE_GSSAPI && USE_SPNEGO */ diff --git a/lib/vtls/sectransp.c b/lib/vtls/sectransp.c index 1e1413f5f2..b6ab3d89df 100644 --- a/lib/vtls/sectransp.c +++ b/lib/vtls/sectransp.c @@ -51,6 +51,11 @@ #pragma GCC diagnostic ignored "-Waddress" #endif +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + #include #include @@ -2770,6 +2775,10 @@ const struct Curl_ssl Curl_ssl_sectransp = { NULL, /* get_channel_binding */ }; +#if defined(__GNUC__) && defined(__APPLE__) +#pragma GCC diagnostic pop +#endif + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif