diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index a695acf2056..077eeb1c07a 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -266,4 +266,12 @@ typedef uintptr_t gpr_uintptr; power of two */ #define GPR_MAX_ALIGNMENT 16 +#ifndef GRPC_MUST_USE_RESULT +#ifdef __GNUC__ +#define GRPC_MUST_USE_RESULT __attribute__ ((warn_unused_result)) +#else +#define GRPC_MUST_USE_RESULT +#endif +#endif + #endif /* GRPC_SUPPORT_PORT_PLATFORM_H */