From: Jim Meyering Date: Tue, 19 Jan 2010 07:47:17 +0000 (+0100) Subject: regex_internal.h: define __attribute_warn_unused_result__ X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54b5ce0e1a4f6a4af37f970e45e6e173e5b0a1c6;p=pspp regex_internal.h: define __attribute_warn_unused_result__ * lib/regex_internal.h (__attribute_warn_unused_result__): Define. --- diff --git a/ChangeLog b/ChangeLog index 8b5597f0db..193d27b229 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2010-01-28 Jim Meyering + 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. diff --git a/lib/regex_internal.h b/lib/regex_internal.h index f5c3125fbd..704d1cc9d6 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -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 */