]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Suppress macOS CC_MD5_* deprecation warnings in the autoconf build too (#2473)
authorMostyn Bramley-Moore <mostyn@antipode.se>
Wed, 1 Jan 2025 23:30:37 +0000 (00:30 +0100)
committerGitHub <noreply@github.com>
Wed, 1 Jan 2025 23:30:37 +0000 (15:30 -0800)
This also limits the amount of code where deprecation warnings are
suppressed.

Previously these warnings were only suppressed in the cmake build.

CMakeLists.txt
libarchive/archive_digest.c

index 036aab30c22902420539383bfffbb4ce74b4b4d8..ec65e83651a344da1331456faffa32e606403fe1 100644 (file)
@@ -2200,11 +2200,6 @@ IF(MSVC)
   ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
 ENDIF(MSVC)
 
-IF(APPLE)
-  # CC_MD5_Init() functions are deprecated on macOS 10.15, but we want to use them
-  ADD_DEFINITIONS(-Wno-deprecated-declarations)
-ENDIF(APPLE)
-
 OPTION(DONT_FAIL_ON_CRC_ERROR "Ignore CRC errors during parsing (For fuzzing)" OFF)
 IF(DONT_FAIL_ON_CRC_ERROR)
   ADD_DEFINITIONS(-DDONT_FAIL_ON_CRC_ERROR=1)
index 3776831b21c9eed5287a39d10d94e08d857f855d..335187408339908dc3f18bd5cebc38213f742d13 100644 (file)
@@ -196,6 +196,13 @@ __archive_md5final(archive_md5_ctx *ctx, void *md)
 
 #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM)
 
+// These functions are available in macOS 10.4 and later, but deprecated from 10.15 onwards.
+// We need to continue supporting this feature regardless, so suppress the warnings.
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 static int
 __archive_md5init(archive_md5_ctx *ctx)
 {
@@ -218,6 +225,10 @@ __archive_md5final(archive_md5_ctx *ctx, void *md)
   return (ARCHIVE_OK);
 }
 
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
 #elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS)
 
 static int