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_