diff options
author | Elliott Hughes <enh@google.com> | 2011-06-07 11:26:02 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2011-06-07 11:26:02 -0700 |
commit | 1a577c958a277329ab2eeb23903d9f8b08e1d35e (patch) | |
tree | 13224c20f20c930ce61f485a6169d27843a7e490 /include/UniquePtr.h | |
parent | 686dd6f676dc348ac260f54e544cf8d813df64a9 (diff) | |
download | libcore-1a577c958a277329ab2eeb23903d9f8b08e1d35e.zip libcore-1a577c958a277329ab2eeb23903d9f8b08e1d35e.tar.gz libcore-1a577c958a277329ab2eeb23903d9f8b08e1d35e.tar.bz2 |
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
Diffstat (limited to 'include/UniquePtr.h')
-rw-r--r-- | include/UniquePtr.h | 4 |
1 files changed, 2 insertions, 2 deletions
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; |