Skip to content

Commit b195aa0

Browse files
sunshinecogitster
authored andcommitted
git-compat-util: suppress unavoidable Apple-specific deprecation warnings
With the release of Mac OS X 10.7 in July 2011, Apple deprecated all openssl.h functionality due to OpenSSL ABI (application binary interface) instability, resulting in an explosion of compilation warnings about deprecated SSL, SHA1, and X509 functions (among others). 6106795 (cache.h: eliminate SHA-1 deprecation warnings on Mac OS X; 2013-05-19) and be4c828 (imap-send: eliminate HMAC deprecation warnings on Mac OS X; 2013-05-19) attempted to ameliorate the situation by taking advantage of drop-in replacement functionality provided by Apple's (ABI-stable) CommonCrypto facility, however CommonCrypto supplies only a subset of deprecated OpenSSL functionality, thus a host of warnings remain. Despite this shortcoming, it was hoped that Apple would ultimately provide CommonCrypto replacements for all deprecated OpenSSL functionality, and that the effort started by 6106795 and be4c828 would be continued and eventually eliminate all deprecation warnings. However, now 3.5 years later, and with Mac OS X at 10.10, the hoped-for CommonCrypto replacements have not yet materialized, nor is there any indication that they will be forthcoming. These Apple-specific warnings are pure noise: they don't tell us anything useful and we have no control over them, nor is Apple likely to provide replacements any time soon. Such noise may obscure other legitimate warnings, therefore silence them. Signed-off-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8213d87 commit b195aa0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

git-compat-util.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,12 @@ extern char *gitbasename(char *);
211211
#endif
212212

213213
#ifndef NO_OPENSSL
214+
#define __AVAILABILITY_MACROS_USES_AVAILABILITY 0
215+
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6
214216
#include <openssl/ssl.h>
215217
#include <openssl/err.h>
218+
#undef MAC_OS_X_VERSION_MIN_REQUIRED
219+
#undef __AVAILABILITY_MACROS_USES_AVAILABILITY
216220
#endif
217221

218222
/* On most systems <netdb.h> would have given us this, but

0 commit comments

Comments
 (0)