diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-21 23:58:09 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-21 23:58:09 +0000 |
commit | dd9afc0b5666f35137c850c8cc625750ae49c223 (patch) | |
tree | 4af8b935421350c2a38c4a5e81e2ffb95f4101f8 /base/compiler_specific.h | |
parent | 6412d3264acd71864fc82ce968fb78d1d1ce1d7e (diff) | |
download | chromium_src-dd9afc0b5666f35137c850c8cc625750ae49c223.zip chromium_src-dd9afc0b5666f35137c850c8cc625750ae49c223.tar.gz chromium_src-dd9afc0b5666f35137c850c8cc625750ae49c223.tar.bz2 |
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
Diffstat (limited to 'base/compiler_specific.h')
-rw-r--r-- | base/compiler_specific.h | 10 |
1 files changed, 8 insertions, 2 deletions
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_ |