From 1a577c958a277329ab2eeb23903d9f8b08e1d35e Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 7 Jun 2011 11:26:02 -0700 Subject: Check that the result of UniquePtr::release is always used. (And silence the warnings in those cases where it isn't because we're working around OpenSSL API lossage.) Change-Id: Ibc7958373e7a899a6cd03a0177f97bf3a73c0e15 --- include/UniquePtr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/UniquePtr.h b/include/UniquePtr.h index f5c7c2c..31db377 100644 --- a/include/UniquePtr.h +++ b/include/UniquePtr.h @@ -64,7 +64,7 @@ public: // Returns the raw pointer and hands over ownership to the caller. // The pointer will not be deleted by UniquePtr. - T* release() { + T* release() __attribute__((warn_unused_result)) { T* result = mPtr; mPtr = NULL; return result; @@ -110,7 +110,7 @@ public: } T* get() const { return mPtr; } - T* release() { + T* release() __attribute__((warn_unused_result)) { T* result = mPtr; mPtr = NULL; return result; -- cgit v1.1