]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib: supress deprecation warnings in apple builds
authorStefan Eissing <stefan@eissing.org>
Tue, 17 Dec 2024 08:45:10 +0000 (09:45 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 17 Dec 2024 13:54:34 +0000 (14:54 +0100)
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

.github/workflows/macos.yml
lib/curl_gssapi.c
lib/krb5.c
lib/ldap.c
lib/socks_gssapi.c
lib/vauth/krb5_gssapi.c
lib/vauth/spnego_gssapi.c
lib/vtls/sectransp.c

index 29f22fdfe2ece01ead253c04f8d4a82c1490d045..a0ddadb49a977025d2899c04f2917432a4d71f8f 100644 (file)
@@ -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)
index b7e774cea018ab507d98dcd372c6a83362a0d9a0..0b383f5066900f9974f744228c77fec49a3ea30c 100644 (file)
 #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 */
index e310a1b57a8ff0bff67ff7fe5f6e3bae96666cf6..4faa26349964bc5e0cbd4807500eb0234c3b997f 100644 (file)
 #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 */
index 2cbdb9c214255418895684cdb1767ec9cca49893..2f9c192fe4c56db85ffe807f7d3c4b90485e5fef 100644 (file)
 
 #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 */
index f6fd55dcec9cbd129ec8fe6530e74b1f64576ef3..776dbdae80a715dbb472a16aab23d8cddaaedf10 100644 (file)
 #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 */
index e79278283800621f1dcd91841d93e2ff769f5367..beaf02729723e4d35927a78471fd5bb069e8b4ec 100644 (file)
 #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 */
index f48d9b7000b257937b850b6b137fec11cff8b020..55232a8e4afb96fd2b3d0c41b63916367aee6fc2 100644 (file)
 #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 */
index 1e1413f5f23c1d663615ad9d70028f7c528ba2c9..b6ab3d89df3ab3e7bddf0abe7a2dd0cc86da36da 100644 (file)
 #pragma GCC diagnostic ignored "-Waddress"
 #endif
 
+#if defined(__GNUC__) && defined(__APPLE__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 #include <limits.h>
 
 #include <Security/Security.h>
@@ -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