diff --git a/Makefile b/Makefile index 00fa92171d7..537f20b97b6 100644 --- a/Makefile +++ b/Makefile @@ -189,9 +189,9 @@ CC_gcov = gcc CXX_gcov = g++ LD_gcov = gcc LDXX_gcov = g++ -CPPFLAGS_gcov = -O0 -fprofile-arcs -ftest-coverage +CPPFLAGS_gcov = -O0 -fprofile-arcs -ftest-coverage -Wno-return-type LDFLAGS_gcov = -fprofile-arcs -ftest-coverage -rdynamic -DEFINES_gcov = _DEBUG DEBUG +DEFINES_gcov = _DEBUG DEBUG GCOV # General settings. diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index 63e692cdb56..2c3df3f3020 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -183,7 +183,7 @@ #endif #define GPR_MSG_IOVLEN_TYPE int #if TARGET_OS_IPHONE -#define GPR_FORBID_UNREACHABLE_CODE +#define GPR_FORBID_UNREACHABLE_CODE 1 #define GPR_PLATFORM_STRING "ios" #define GPR_CPU_IPHONE 1 #define GPR_PTHREAD_TLS 1 @@ -252,6 +252,11 @@ #define GPR_PLATFORM_STRING "unknown" #endif +#ifdef GCOV +#undef GPR_FORBID_UNREACHABLE_CODE +#define GPR_FORBID_UNREACHABLE_CODE 1 +#endif + /* For a common case, assume that the platform has a C99-like stdint.h */ #include @@ -337,7 +342,7 @@ typedef uintptr_t gpr_uintptr; #endif #endif -#ifdef GPR_FORBID_UNREACHABLE_CODE +#if GPR_FORBID_UNREACHABLE_CODE #define GPR_UNREACHABLE_CODE(STATEMENT) #else #define GPR_UNREACHABLE_CODE(STATEMENT) \ diff --git a/templates/Makefile.template b/templates/Makefile.template index 20d14c797f9..e01185783d3 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -205,9 +205,9 @@ CXX_gcov = g++ LD_gcov = gcc LDXX_gcov = g++ - CPPFLAGS_gcov = -O0 -fprofile-arcs -ftest-coverage + CPPFLAGS_gcov = -O0 -fprofile-arcs -ftest-coverage -Wno-return-type LDFLAGS_gcov = -fprofile-arcs -ftest-coverage -rdynamic - DEFINES_gcov = _DEBUG DEBUG + DEFINES_gcov = _DEBUG DEBUG GCOV # General settings.