commit | dd9afc0b5666f35137c850c8cc625750ae49c223 | [log] [tgz] |
---|---|---|
author | [email protected] <[email protected]@0039d316-1c4b-4281-b951-d872f2087c98> | Fri Nov 21 23:58:09 2008 |
committer | [email protected] <[email protected]@0039d316-1c4b-4281-b951-d872f2087c98> | Fri Nov 21 23:58:09 2008 |
tree | 4af8b935421350c2a38c4a5e81e2ffb95f4101f8 | |
parent | 6412d3264acd71864fc82ce968fb78d1d1ce1d7e [diff] [blame] |
Generate a warning if the return value of FilePath::Append is ignored. There's currently a GCC bug which stops this working for return values which have a destructor. Hopefully this will help someone in the future, with future versions of GCC. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38172 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31742 Review URL: http://codereview.chromium.org/11494 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5871 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/compiler_specific.h b/base/compiler_specific.h index c9b7535..11777fb 100644 --- a/base/compiler_specific.h +++ b/base/compiler_specific.h
@@ -53,7 +53,7 @@ code \ MSVC_POP_WARNING() -#else // COMPILER_MSVC +#else // Not MSVC #define MSVC_SUPPRESS_WARNING(n) #define MSVC_PUSH_DISABLE_WARNING(n) @@ -65,5 +65,11 @@ #endif // COMPILER_MSVC -#endif // BASE_COMPILER_SPECIFIC_H_ +#if defined(COMPILER_GCC) +#define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else // Not GCC +#define WARN_UNUSED_RESULT +#endif + +#endif // BASE_COMPILER_SPECIFIC_H_