Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [PATCH] git-compat-util: do not step on MAC_OS_X_VERSION_MIN_REQUIRED

From: Eric Sunshine <hidden>
Date: 2016-06-15 23:03:45

On Fri, Feb 6, 2015 at 3:43 PM, Kyle J. McKay [off-list ref] wrote:
On Feb 6, 2015, at 12:05, Junio C Hamano wrote:
quoted
"Kyle J. McKay" [off-list ref] writes:
quoted
So I think it needs to stay #define'd to nothing to be safe in case
anything later on ends up including stuff that uses it.
Doesn't the fact that your test failed indicates that it is not jsut
"to be safe in case" but is required for correctness?

[...] I do not know what
changes they make to openssl/*.h (which is included just after the
above header is included, but I would imagine that is where the
AVAILABLE_MAC_OS_X_VERSION_XXX_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_VERSION_YYY
macros are checked and annoying warnings that are being squelched by
the previous change are given?
Yes.

Although Eric didn't specify exactly where when he suggested adding this:

On Feb 6, 2015, at 02:00, Eric Sunshine wrote:
quoted
   #ifdef __APPLE__
   #undef DEPRECATED_ATTRIBUTE
   #endif
I took the suggestion to be after the openssl/*.h headers are included which
would avoid the error of having DEPRECATED_ATTRIBUTE be #undef'd for them.
But, even math.h can end up including AvailabilityMacros.h, so I think
#undef'ing DEPRECATED_ATTRIBUTE after the openssl/*.h headers are included
would be unsafe in general.  While we might happen to get away with that
today, if say compat/apple-common-crypto.h changes in the future (or for
that matter any sequence of includes in other files or any headers in the
Apple SDK) we could start seeing the error.

TLDR; yeah, DEPRECATED_ATTRIBUTE needs to remain defined to nothing.
I agree with this analysis. An alternative would be to revert b195aa00
(and not apply this patch), but then we risk having legitimate
Git-related compilation warnings lost in the noise of the useless
Apple deprecation warnings.  Given the glacial pace at which Apple
headers changes, and considering the rapid pace of change in Git, it
still seems the lesser evil to suppress the useless warnings Apple
thrust upon us when they deprecated OpenSSL in its entirety without
providing replacements. It's unfortunate that the DEPRECATED_ATTRIBUTE
#define will bleed beyond the OpenSSL #includes and potentially allow
us to miss some future Apple deprecations, however, given the
shortcomings of b195aa00, the proposed patch seems to be the best we
can do.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help