From: Mostyn Bramley-Moore Date: Wed, 1 Jan 2025 23:30:37 +0000 (+0100) Subject: Suppress macOS CC_MD5_* deprecation warnings in the autoconf build too (#2473) X-Git-Tag: v3.8.0~76 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=7708713b634eb2f72ffe484b565a5a87f58e8cb3;p=thirdparty%2Flibarchive.git Suppress macOS CC_MD5_* deprecation warnings in the autoconf build too (#2473) This also limits the amount of code where deprecation warnings are suppressed. Previously these warnings were only suppressed in the cmake build. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 036aab30c..ec65e8365 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/libarchive/archive_digest.c b/libarchive/archive_digest.c index 3776831b2..335187408 100644 --- a/libarchive/archive_digest.c +++ b/libarchive/archive_digest.c @@ -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