changeset 12828:6c20461f3ecf

regex_internal.h: define __attribute_warn_unused_result__ * lib/regex_internal.h (__attribute_warn_unused_result__): Define.
author Jim Meyering <meyering@redhat.com>
date Tue, 19 Jan 2010 08:47:17 +0100
parents d844fd639561
children 971957a253f8
files ChangeLog lib/regex_internal.h
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-01-28  Jim Meyering  <meyering@redhat.com>
 
+	regex_internal.h: define __attribute_warn_unused_result__
+	* lib/regex_internal.h (__attribute_warn_unused_result__): Define.
+
 	maint: add a syntax-check rule to check for vulnerable Makefile.in
 	* top/maint.mk (sc_vulnerable_makefile_CVE-2009-4029): New rule.
 
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -851,4 +851,12 @@
 }
 #endif /* RE_ENABLE_I18N */
 
+#if __GNUC_PREREQ (3,4)
+# undef __attribute_warn_unused_result__
+# define __attribute_warn_unused_result__ \
+   __attribute__ ((__warn_unused_result__))
+#else
+# define __attribute_warn_unused_result__ /* empty */
+#endif
+
 #endif /*  _REGEX_INTERNAL_H */