bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regex_internal.h modification lead to GCC crash


From: Paul Eggert
Subject: Re: regex_internal.h modification lead to GCC crash
Date: Mon, 19 Sep 2005 22:52:01 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

This is getting a bit complicated and I suspect we will run into
further problems like this....

How about if we do this instead?  The basic idea is to shut off
__attribute__ entirely for GCC before 3.1.  There's little point to
figuring out exactly when each attribute was added.  We can simply
pick a single reasonable cutoff for the GCC versions we cater to well
(for now, 3.1 -- we can maybe change it later).  All we need to do is
ensure the code works with older compilers; it needn't be
super-optimized.

--- regex_internal.h    2005-09-15 17:23:36.000000000 -0700
+++ /tmp/regex_internal.h       2005-09-19 22:50:27.000000000 -0700
@@ -84,19 +84,6 @@
 # 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
@@ -127,7 +114,7 @@
 # define attribute_hidden
 #endif /* not _LIBC */
 
-#ifdef __GNUC__
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
 # define __attribute(arg) __attribute__ (arg)
 #else
 # define __attribute(arg)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]