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
This commit is contained in:
Stefan Eissing 2024-12-17 09:45:10 +01:00 committed by Daniel Stenberg
parent f7e065f314
commit ef90ee39e1
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
8 changed files with 64 additions and 4 deletions

View File

@ -45,9 +45,6 @@ permissions: {}
# #
# For Secure Transport, curl implements features that require a target # For Secure Transport, curl implements features that require a target
# newer than the 10.8 required by `CFURLCreateDataAndPropertiesFromResource`. # 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: env:
LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings
@ -118,7 +115,6 @@ jobs:
compiler: clang compiler: clang
configure: --enable-debug --with-secure-transport --with-libssh2=$(brew --prefix libssh2) configure: --enable-debug --with-secure-transport --with-libssh2=$(brew --prefix libssh2)
macos-version-min: '10.12' # for monotonic timers macos-version-min: '10.12' # for monotonic timers
cflags: '-Wno-deprecated-declarations'
- name: 'SecureTransport libssh2' - name: 'SecureTransport libssh2'
compiler: gcc-12 compiler: gcc-12
configure: --enable-debug --with-secure-transport --with-libssh2=$(brew --prefix libssh2) configure: --enable-debug --with-secure-transport --with-libssh2=$(brew --prefix libssh2)

View File

@ -40,6 +40,11 @@
#define CURL_ALIGN8 #define CURL_ALIGN8
#endif #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 = { gss_OID_desc Curl_spnego_mech_oid CURL_ALIGN8 = {
6, (char *)"\x2b\x06\x01\x05\x05\x02" 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 #endif
} }
#if defined(__GNUC__) && defined(__APPLE__)
#pragma GCC diagnostic pop
#endif
#endif /* HAVE_GSSAPI */ #endif /* HAVE_GSSAPI */

View File

@ -63,6 +63,11 @@
#include "curl_memory.h" #include "curl_memory.h"
#include "memdebug.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, static CURLcode ftpsend(struct Curl_easy *data, struct connectdata *conn,
const char *cmd) const char *cmd)
{ {
@ -924,4 +929,8 @@ Curl_sec_end(struct connectdata *conn)
conn->mech = NULL; conn->mech = NULL;
} }
#if defined(__GNUC__) && defined(__APPLE__)
#pragma GCC diagnostic pop
#endif
#endif /* HAVE_GSSAPI && !CURL_DISABLE_FTP */ #endif /* HAVE_GSSAPI && !CURL_DISABLE_FTP */

View File

@ -26,6 +26,11 @@
#if !defined(CURL_DISABLE_LDAP) && !defined(USE_OPENLDAP) #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 * Notice that USE_OPENLDAP is only a source code selection switch. When
* libcurl is built with USE_OPENLDAP defined the libcurl source code that * 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); free(ludp);
} }
#endif /* !HAVE_LDAP_URL_PARSE */ #endif /* !HAVE_LDAP_URL_PARSE */
#if defined(__GNUC__) && defined(__APPLE__)
#pragma GCC diagnostic pop
#endif
#endif /* !CURL_DISABLE_LDAP && !USE_OPENLDAP */ #endif /* !CURL_DISABLE_LDAP && !USE_OPENLDAP */

View File

@ -42,6 +42,11 @@
#include "curl_memory.h" #include "curl_memory.h"
#include "memdebug.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 #define MAX_GSS_LEN 1024
static gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT; 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; return CURLE_OK;
} }
#if defined(__GNUC__) && defined(__APPLE__)
#pragma GCC diagnostic pop
#endif
#endif /* HAVE_GSSAPI && !CURL_DISABLE_PROXY */ #endif /* HAVE_GSSAPI && !CURL_DISABLE_PROXY */

View File

@ -42,6 +42,11 @@
#include "curl_memory.h" #include "curl_memory.h"
#include "memdebug.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() * 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 */ #endif /* HAVE_GSSAPI && USE_KERBEROS5 */

View File

@ -42,6 +42,11 @@
#include "curl_memory.h" #include "curl_memory.h"
#include "memdebug.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() * Curl_auth_is_spnego_supported()
* *
@ -288,4 +293,8 @@ void Curl_auth_cleanup_spnego(struct negotiatedata *nego)
nego->havemultiplerequests = FALSE; nego->havemultiplerequests = FALSE;
} }
#if defined(__GNUC__) && defined(__APPLE__)
#pragma GCC diagnostic pop
#endif
#endif /* HAVE_GSSAPI && USE_SPNEGO */ #endif /* HAVE_GSSAPI && USE_SPNEGO */

View File

@ -51,6 +51,11 @@
#pragma GCC diagnostic ignored "-Waddress" #pragma GCC diagnostic ignored "-Waddress"
#endif #endif
#if defined(__GNUC__) && defined(__APPLE__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#include <limits.h> #include <limits.h>
#include <Security/Security.h> #include <Security/Security.h>
@ -2770,6 +2775,10 @@ const struct Curl_ssl Curl_ssl_sectransp = {
NULL, /* get_channel_binding */ NULL, /* get_channel_binding */
}; };
#if defined(__GNUC__) && defined(__APPLE__)
#pragma GCC diagnostic pop
#endif
#ifdef __GNUC__ #ifdef __GNUC__
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif