regex_internal.h: define __attribute_warn_unused_result__
authorJim Meyering <meyering@redhat.com>
Tue, 19 Jan 2010 07:47:17 +0000 (08:47 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 28 Jan 2010 10:33:23 +0000 (11:33 +0100)
* lib/regex_internal.h (__attribute_warn_unused_result__): Define.

ChangeLog
lib/regex_internal.h

index 8b5597f0dbe2504c30b76deab5487c10f1d5ca0a..193d27b229745416c568f1d913a2c60e481f7a54 100644 (file)
--- 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.
 
index f5c3125fbdc99e914ee7b637561f90253ed039bc..704d1cc9d6d174b7e2ecaf187bd55c28ce6ea189 100644 (file)
@@ -851,4 +851,12 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx)
 }
 #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 */