From 4ac2b8e585cbf7064f9bdde4eabaf8ff42801142 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 10 Nov 2017 14:14:17 -0800 Subject: Enable clang-tidy as a sanity check, fix up all known failures --- src/core/lib/iomgr/error.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core/lib/iomgr/error.h') diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index 36ba440c8a..8d7aea4872 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -24,6 +24,7 @@ #include #include +#include #include #include "src/core/lib/debug/trace.h" @@ -184,9 +185,15 @@ grpc_error* grpc_error_add_child(grpc_error* src, grpc_error* child) GRPC_MUST_USE_RESULT; grpc_error* grpc_os_error(const char* file, int line, int err, const char* call_name) GRPC_MUST_USE_RESULT; + +inline grpc_error* grpc_assert_never_ok(grpc_error* error) { + GPR_ASSERT(error != GRPC_ERROR_NONE); + return error; +} + /// create an error associated with errno!=0 (an 'operating system' error) #define GRPC_OS_ERROR(err, call_name) \ - grpc_os_error(__FILE__, __LINE__, err, call_name) + grpc_assert_never_ok(grpc_os_error(__FILE__, __LINE__, err, call_name)) grpc_error* grpc_wsa_error(const char* file, int line, int err, const char* call_name) GRPC_MUST_USE_RESULT; /// windows only: create an error associated with WSAGetLastError()!=0 -- cgit v1.2.3