From c6ae9b562bc14780c1b4022e1851a9a843e5e145 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Thu, 4 Jan 2018 16:29:06 -0800 Subject: [PATCH] Silence openssl 1.1.0 warnings --- Makefile | 2 +- build.yaml | 1 + grpc.gyp | 3 +++ include/grpc/impl/codegen/port_platform.h | 8 ++++++++ src/core/tsi/ssl_transport_security.cc | 3 +++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e51882c3640..9687e8277c2 100644 --- a/Makefile +++ b/Makefile @@ -327,7 +327,7 @@ CXXFLAGS += -std=c++11 ifeq ($(SYSTEM),Darwin) CXXFLAGS += -stdlib=libc++ endif -CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 +CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Wno-deprecated-declarations COREFLAGS += -fno-rtti -fno-exceptions LDFLAGS += -g diff --git a/build.yaml b/build.yaml index 42d72459811..fef7d6189f7 100644 --- a/build.yaml +++ b/build.yaml @@ -5004,6 +5004,7 @@ defaults: global: COREFLAGS: -fno-rtti -fno-exceptions CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 + -Wno-deprecated-declarations LDFLAGS: -g zlib: CFLAGS: -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-implicit-function-declaration diff --git a/grpc.gyp b/grpc.gyp index c34206b1a5d..06da3a758fb 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -57,6 +57,7 @@ '-Wno-long-long', '-Wno-unused-parameter', '-DOSATOMIC_USE_INLINED=1', + '-Wno-deprecated-declarations', ], 'ldflags': [ '-g', @@ -134,6 +135,7 @@ '-Wno-long-long', '-Wno-unused-parameter', '-DOSATOMIC_USE_INLINED=1', + '-Wno-deprecated-declarations', ], 'OTHER_CPLUSPLUSFLAGS': [ '-g', @@ -143,6 +145,7 @@ '-Wno-long-long', '-Wno-unused-parameter', '-DOSATOMIC_USE_INLINED=1', + '-Wno-deprecated-declarations', '-stdlib=libc++', '-std=c++11', '-Wno-error=deprecated-declarations' diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index f4bc3eb3e03..1c03197db5d 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -421,6 +421,14 @@ typedef unsigned __int64 uint64_t; #endif #endif +#ifndef GRPC_UNUSED +#if defined(__GNUC__) && !defined(__MINGW32__) +#define GRPC_UNUSED __attribute__((unused)) +#else +#define GRPC_UNUSED +#endif +#endif + #ifndef GPR_PRINT_FORMAT_CHECK #ifdef __GNUC__ #define GPR_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS) \ diff --git a/src/core/tsi/ssl_transport_security.cc b/src/core/tsi/ssl_transport_security.cc index f35caef6402..229f7efd373 100644 --- a/src/core/tsi/ssl_transport_security.cc +++ b/src/core/tsi/ssl_transport_security.cc @@ -116,6 +116,9 @@ typedef struct { static gpr_once init_openssl_once = GPR_ONCE_INIT; static gpr_mu* openssl_mutexes = nullptr; +static void openssl_locking_cb(int mode, int type, const char* file, + int line) GRPC_UNUSED; +static unsigned long openssl_thread_id_cb(void) GRPC_UNUSED; static void openssl_locking_cb(int mode, int type, const char* file, int line) { if (mode & CRYPTO_LOCK) {