aboutsummaryrefslogtreecommitdiff
path: root/src/common/basictypes.h
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-12-18 19:52:36 +0000
committerthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-12-18 19:52:36 +0000
commit74f640a92eff557e0ebef7de8f9f0c4d61bd5f06 (patch)
tree826804f81b5d038c26233e8a904d5c4299ef80e0 /src/common/basictypes.h
parentSwitch scoped_ptr.h to a compatible google3 implementation. (diff)
downloadbreakpad-74f640a92eff557e0ebef7de8f9f0c4d61bd5f06.tar.xz
Use a proper ignore_result() to fix a ftruncate warn_unused_result warning with GCC 4.8.
BUG=492 R=mark@chromium.org Review URL: https://breakpad.appspot.com/944003 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1266 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/basictypes.h')
-rw-r--r--src/common/basictypes.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/common/basictypes.h b/src/common/basictypes.h
index 84668b79..9426c1f6 100644
--- a/src/common/basictypes.h
+++ b/src/common/basictypes.h
@@ -38,4 +38,21 @@
void operator=(const TypeName&)
#endif // DISALLOW_COPY_AND_ASSIGN
+namespace google_breakpad {
+
+// Used to explicitly mark the return value of a function as unused. If you are
+// really sure you don't want to do anything with the return value of a function
+// that has been marked with __attribute__((warn_unused_result)), wrap it with
+// this. Example:
+//
+// scoped_ptr<MyType> my_var = ...;
+// if (TakeOwnership(my_var.get()) == SUCCESS)
+// ignore_result(my_var.release());
+//
+template<typename T>
+inline void ignore_result(const T&) {
+}
+
+} // namespace google_breakpad
+
#endif // COMMON_BASICTYPES_H_