mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-01 20:24:40 +01:00
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
This commit is contained in:
parent
15873e0016
commit
74f640a92e
2 changed files with 19 additions and 1 deletions
|
|
@ -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_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue