about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2014-02-28 17:22:06 -0800
committerPaul Pluzhnikov <ppluzhnikov@google.com>2014-02-28 17:22:06 -0800
commit63473c36767faa85fe43ad34c3b600adcfdb5e99 (patch)
tree03b7d697c5e41ee0df5d33fef576a565bc772f80
parent283b5c7b391ab61544cf2f8883fdff152202a740 (diff)
downloadglibc-63473c36767faa85fe43ad34c3b600adcfdb5e99.tar.gz
glibc-63473c36767faa85fe43ad34c3b600adcfdb5e99.tar.xz
glibc-63473c36767faa85fe43ad34c3b600adcfdb5e99.zip
Disable gcc's __warn_unused_result__ attribute in glibc headers when _GOOGLE_FORTIFY_SOURCE_NO_WARN_UNUSED_RESULT is specified.
-rw-r--r--README.google9
-rw-r--r--misc/sys/cdefs.h7
2 files changed, 16 insertions, 0 deletions
diff --git a/README.google b/README.google
index c13b1ab510..b1a2c0c700 100644
--- a/README.google
+++ b/README.google
@@ -138,3 +138,12 @@ elf/rtld.c
   Forward-ported from cl/51332859 (from cl/51576-p2 and cl/51620-p2).
   (ppluzhnikov, google-local)
 
+misc/sys/cdefs.h
+  g/grte-team/browse_thread/thread/d08601e9f5542d94
+  Disable gcc's __warn_unused_result__ attribute in glibc headers when
+  _GOOGLE_FORTIFY_SOURCE_NO_WARN_UNUSED_RESULT is specified, even if
+  _FORTIFY_SOURCE is set.  Some google3 code does not compile when this
+  attribute is set on some glibc functions.
+  Forward-ported from cl/51334004 (from cl/53404-p2).
+  (swiecki, google-local)
+
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 4d958ea066..c867be7cfe 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -303,6 +303,13 @@
 # define __wur /* Ignore */
 #endif
 
+/* Google specific: Disable __warn_unused_result__ attribute even if
+   _FORTIFY_SOURCE is specified. Not all google3 code compiles when it's set */
+#ifdef _GOOGLE_FORTIFY_SOURCE_NO_WARN_UNUSED_RESULT
+# undef __wur
+# define __wur /* Ignore */
+#endif
+
 /* Forces a function to be always inlined.  */
 #if __GNUC_PREREQ (3,2)
 # define __always_inline __inline __attribute__ ((__always_inline__))