From b7f9037443c256c2ed36e35a084030d68a4ab088 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 25 Sep 2005 04:20:16 +0000 Subject: [PATCH] * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure): Remove. (__attribute): Define to empty unless GCC 3.1 or later. This works around a core dump on OpenBSD 3.4, which has GCC 2.95.3, which dumps core when given __attribute__(()). It also simplifies other tests, since we really don't want to bother with worrying about which ancient version of GCC supported what. Original problem reported by Yoann Vandoorselaere, with part of the fix suggested by Derek Price. --- lib/ChangeLog | 10 ++++++++-- lib/regex_internal.h | 17 +---------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index a1ab6ad669..ba902ab735 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,8 +1,14 @@ 2005-09-24 Paul Eggert - * regex_internal.h (__attribute): Define to nothing for GCC 2. + * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure): + Remove. + (__attribute): Define to empty unless GCC 3.1 or later. This works around a core dump on OpenBSD 3.4, which has GCC - 2.95.3, which dumps core when given __attribute__(()). + 2.95.3, which dumps core when given __attribute__(()). It also + simplifies other tests, since we really don't want to bother with + worrying about which ancient version of GCC supported what. + Original problem reported by Yoann Vandoorselaere, with part of + the fix suggested by Derek Price. 2005-09-24 Jim Meyering diff --git a/lib/regex_internal.h b/lib/regex_internal.h index 3616473446..a36ae4c8a1 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -88,25 +88,10 @@ # define RE_ENABLE_I18N #endif -#ifndef __GNUC_PREREQ -# if defined __GNUC__ && defined __GNUC_MINOR__ -# define __GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -# else -# define __GNUC_PREREQ(maj, min) 0 -# endif -#endif - -#if !__GNUC_PREREQ (3, 1) -# define always_inline -#endif - #if __GNUC__ >= 3 # define BE(expr, val) __builtin_expect (expr, val) #else # define BE(expr, val) (expr) -# define inline -# define pure #endif /* Number of single byte character. */ @@ -131,7 +116,7 @@ # define attribute_hidden #endif /* not _LIBC */ -#if __GNUC__ >= 3 +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) # define __attribute(arg) __attribute__ (arg) #else # define __attribute(arg) -- 2.30.2