kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/4] kudu git commit: [gutil] suppress -Wdeprecated-declarations warning on macOS
Date Wed, 09 Jan 2019 06:22:06 GMT
[gutil] suppress -Wdeprecated-declarations warning on macOS

As it turned out, most of the atomic functions used in
atomicops-internals-macosx.h have been declared deprecated since
macOS 10.12, most of the functions in the SASL API are deprecated
since macOS 10.11, and the krb5 API is deprecated in favor
of GSS.framework.

To avoid multiple compilation warnings on macOS while compiling
with clang from the Xcode development environment, this changelist adds
'pragma GCC diagnostic push/pop' for the '-Wdeprecated-declarations'
flag accordingly.  It's confirmed that this patch suppresses
deprecation warnings at least on macOS 10.14.

This is a follow-up to 678dbac6fb05d0370e40e6645d4b1ec530fa0180.

Change-Id: I82b0ebd9917a567d1a8b72c80b47dc102304d860
Reviewed-on: http://gerrit.cloudera.org:8080/12183
Reviewed-by: Adar Dembo <adar@cloudera.com>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/7ca5fc6a
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/7ca5fc6a
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/7ca5fc6a

Branch: refs/heads/master
Commit: 7ca5fc6aebd2d543ba9d53a3f802c12a0ea6cc84
Parents: af21add
Author: Alexey Serbin <alexey@apache.org>
Authored: Tue Jan 8 14:54:00 2019 -0800
Committer: Alexey Serbin <aserbin@cloudera.com>
Committed: Wed Jan 9 00:42:41 2019 +0000

----------------------------------------------------------------------
 src/kudu/gutil/atomicops-internals-macosx.h |  7 +++++++
 src/kudu/rpc/client_negotiation.cc          | 11 +++++++++++
 src/kudu/rpc/negotiation-test.cc            | 11 +++++++++++
 src/kudu/rpc/sasl_common.cc                 | 11 +++++++++++
 src/kudu/rpc/sasl_common.h                  | 11 +++++++++++
 src/kudu/rpc/server_negotiation.cc          | 11 +++++++++++
 src/kudu/security/init.cc                   | 12 ++++++++++++
 src/kudu/thrift/sasl_client_transport.cc    | 11 +++++++++++
 8 files changed, 85 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/7ca5fc6a/src/kudu/gutil/atomicops-internals-macosx.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/atomicops-internals-macosx.h b/src/kudu/gutil/atomicops-internals-macosx.h
index d141d1d..a260d3b 100644
--- a/src/kudu/gutil/atomicops-internals-macosx.h
+++ b/src/kudu/gutil/atomicops-internals-macosx.h
@@ -29,6 +29,11 @@ typedef int64_t Atomic64;
 
 #include <libkern/OSAtomic.h>
 
+// Almost all OSAtomicXxx functions used in this header are marked
+// as deprecated since macOS 10.12.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 #if !defined(__LP64__) && defined(__ppc__)
 
 // The Mac 64-bit OSAtomic implementations are not available for 32-bit PowerPC,
@@ -399,6 +404,8 @@ inline Atomic64 Release_Load(volatile const Atomic64 *ptr) {
 }   // namespace base::subtle
 }   // namespace base
 
+#pragma GCC diagnostic pop
+
 // NOTE(user): The following is also deprecated.  New callers should use
 // the base::subtle namespace.
 inline void MemoryBarrier() {

http://git-wip-us.apache.org/repos/asf/kudu/blob/7ca5fc6a/src/kudu/rpc/client_negotiation.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/client_negotiation.cc b/src/kudu/rpc/client_negotiation.cc
index 02175f6..e003a2c 100644
--- a/src/kudu/rpc/client_negotiation.cc
+++ b/src/kudu/rpc/client_negotiation.cc
@@ -52,6 +52,13 @@
 #include "kudu/util/slice.h"
 #include "kudu/util/trace.h"
 
+#if defined(__APPLE__)
+// Almost all functions in the SASL API are marked as deprecated
+// since macOS 10.11.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // #if defined(__APPLE__)
+
 using std::map;
 using std::set;
 using std::string;
@@ -851,3 +858,7 @@ Status ClientNegotiation::CheckGSSAPI() {
 
 } // namespace rpc
 } // namespace kudu
+
+#if defined(__APPLE__)
+#pragma GCC diagnostic pop
+#endif // #if defined(__APPLE__)

http://git-wip-us.apache.org/repos/asf/kudu/blob/7ca5fc6a/src/kudu/rpc/negotiation-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/negotiation-test.cc b/src/kudu/rpc/negotiation-test.cc
index c463df7..f3990ac 100644
--- a/src/kudu/rpc/negotiation-test.cc
+++ b/src/kudu/rpc/negotiation-test.cc
@@ -80,6 +80,13 @@
 #define KRB5_VERSION_LE_1_10
 #endif
 
+#if defined(__APPLE__)
+// Almost all functions in the SASL API are marked as deprecated
+// since macOS 10.11.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // #if defined(__APPLE__)
+
 DEFINE_bool(is_test_child, false,
             "Used by tests which require clean processes. "
             "See TestDisableInit.");
@@ -1346,3 +1353,7 @@ TEST_F(TestDisableInit, TestMultipleSaslInit_NoMutexImpl) {
 
 } // namespace rpc
 } // namespace kudu
+
+#if defined(__APPLE__)
+#pragma GCC diagnostic pop
+#endif // #if defined(__APPLE__)

http://git-wip-us.apache.org/repos/asf/kudu/blob/7ca5fc6a/src/kudu/rpc/sasl_common.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/sasl_common.cc b/src/kudu/rpc/sasl_common.cc
index 645e854..0107fba 100644
--- a/src/kudu/rpc/sasl_common.cc
+++ b/src/kudu/rpc/sasl_common.cc
@@ -37,6 +37,13 @@
 #include "kudu/util/net/sockaddr.h"
 #include "kudu/util/rw_mutex.h"
 
+#if defined(__APPLE__)
+// Almost all functions in the SASL API are marked as deprecated
+// since macOS 10.11.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // #if defined(__APPLE__)
+
 using std::set;
 using std::string;
 
@@ -468,3 +475,7 @@ const char* SaslProtection::name_of(SaslProtection::Type val) {
 
 } // namespace rpc
 } // namespace kudu
+
+#if defined(__APPLE__)
+#pragma GCC diagnostic pop
+#endif // #if defined(__APPLE__)

http://git-wip-us.apache.org/repos/asf/kudu/blob/7ca5fc6a/src/kudu/rpc/sasl_common.h
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/sasl_common.h b/src/kudu/rpc/sasl_common.h
index 2454cfd..c550882 100644
--- a/src/kudu/rpc/sasl_common.h
+++ b/src/kudu/rpc/sasl_common.h
@@ -30,6 +30,13 @@
 #include "kudu/util/slice.h"
 #include "kudu/util/status.h"
 
+#if defined(__APPLE__)
+// Almost all functions in the SASL API are marked as deprecated
+// since macOS 10.11.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // #if defined(__APPLE__)
+
 namespace kudu {
 
 class Sockaddr;
@@ -155,4 +162,8 @@ void SaslSetMutex();
 } // namespace rpc
 } // namespace kudu
 
+#if defined(__APPLE__)
+#pragma GCC diagnostic pop
+#endif // #if defined(__APPLE__)
+
 #endif

http://git-wip-us.apache.org/repos/asf/kudu/blob/7ca5fc6a/src/kudu/rpc/server_negotiation.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/server_negotiation.cc b/src/kudu/rpc/server_negotiation.cc
index 612701f..ac641b1 100644
--- a/src/kudu/rpc/server_negotiation.cc
+++ b/src/kudu/rpc/server_negotiation.cc
@@ -58,6 +58,13 @@
 #include "kudu/util/slice.h"
 #include "kudu/util/trace.h"
 
+#if defined(__APPLE__)
+// Almost all functions in the SASL API are marked as deprecated
+// since macOS 10.11.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // #if defined(__APPLE__)
+
 using std::set;
 using std::string;
 using std::unique_ptr;
@@ -987,3 +994,7 @@ bool ServerNegotiation::IsTrustedConnection(const Sockaddr& addr)
{
 
 } // namespace rpc
 } // namespace kudu
+
+#if defined(__APPLE__)
+#pragma GCC diagnostic pop
+#endif // #if defined(__APPLE__)

http://git-wip-us.apache.org/repos/asf/kudu/blob/7ca5fc6a/src/kudu/security/init.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/init.cc b/src/kudu/security/init.cc
index ee754eb..58ef83c 100644
--- a/src/kudu/security/init.cc
+++ b/src/kudu/security/init.cc
@@ -48,6 +48,13 @@
 #include "kudu/util/status.h"
 #include "kudu/util/thread.h"
 
+#if defined(__APPLE__)
+// Almost all functions in the krb5 API are marked as deprecated in favor
+// of GSS.framework in macOS.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // #if defined(__APPLE__)
+
 #ifndef __APPLE__
 static constexpr bool kDefaultSystemAuthToLocal = true;
 #else
@@ -56,6 +63,7 @@ static constexpr bool kDefaultSystemAuthToLocal = true;
 // implementation.
 static constexpr bool kDefaultSystemAuthToLocal = false;
 #endif
+
 DEFINE_bool(use_system_auth_to_local, kDefaultSystemAuthToLocal,
             "When enabled, use the system krb5 library to map Kerberos principal "
             "names to local (short) usernames. If not enabled, the first component "
@@ -463,3 +471,7 @@ Status InitKerberosForServer(const std::string& raw_principal, const
std::string
 
 } // namespace security
 } // namespace kudu
+
+#if defined(__APPLE__)
+#pragma GCC diagnostic pop
+#endif // #if defined(__APPLE__)

http://git-wip-us.apache.org/repos/asf/kudu/blob/7ca5fc6a/src/kudu/thrift/sasl_client_transport.cc
----------------------------------------------------------------------
diff --git a/src/kudu/thrift/sasl_client_transport.cc b/src/kudu/thrift/sasl_client_transport.cc
index 80ea0c2..efb2db6 100644
--- a/src/kudu/thrift/sasl_client_transport.cc
+++ b/src/kudu/thrift/sasl_client_transport.cc
@@ -38,6 +38,13 @@
 #include "kudu/util/slice.h"
 #include "kudu/util/status.h"
 
+#if defined(__APPLE__)
+// Almost all functions in the SASL API are marked as deprecated
+// since macOS 10.11.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif // #if defined(__APPLE__)
+
 using apache::thrift::transport::TTransportException;
 using std::shared_ptr;
 using std::string;
@@ -401,3 +408,7 @@ void SaslClientTransport::ResetWriteBuf() {
 
 } // namespace thrift
 } // namespace kudu
+
+#if defined(__APPLE__)
+#pragma GCC diagnostic pop
+#endif // #if defined(__APPLE__)


Mime
View raw message