Re: gnulib features.h?

2005-09-15 Thread Paul Eggert
Derek Price <[EMAIL PROTECTED]> writes:

> is there a simple reference I could use to find what version of GCC an
> attribute first appeared in?  Something easier than fumbling through the
> CVS history, that is.  :)

Not that I know of, sorry.  I've had the same problem myself.

I have looked at the GCC NEWS file, which sometimes works, but
sometimes not.


___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib


Re: gnulib features.h?

2005-09-15 Thread Paul Eggert
Derek Price <[EMAIL PROTECTED]> writes:

> 2005-09-15  Derek Price  <[EMAIL PROTECTED]>
>  
>* regex_internal.h: Blank `pure' for GNUC < 3.
>* regex_internal.c: Ditto, using this...
>(__GNUC_PREREQ): ...new macro.
>* regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
>(__GNUC_PREREQ): ...this new macro.

We don't need all thse definitions of __GNUC_PREREQ, since
regex_internal.h is included before the other .c files are; see
regex.c.  Could you please simplify the patch accordingly?  Only
regex_internal.h should need changes from yesterday's state; the other
files can remain unchanged from yesterday.  Thanks.

(I see you didn't pick up on my features.h idea.  That's OK; we can do
it later if people like it)


___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib


Re: gnulib features.h?

2005-09-15 Thread Derek Price
Paul Eggert wrote:

>We don't need all thse definitions of __GNUC_PREREQ, since
>regex_internal.h is included before the other .c files are; see
>regex.c.  Could you please simplify the patch accordingly?  Only
>  
>

I've attached hte following for review since I took the liberty of
replacing two #if __GNUC__ >= constructs in regex_internal.h with
__GNUC_PREREQ calls.

2005-09-15  Derek Price  <[EMAIL PROTECTED]>

* regcomp.c, regexec.c, regex_internal.c: Back out previous
changes, consolidating in...
* regex_internal.h: ...this file.  Replace two #if __GNUC__ >= X
with calls to...
(__GNUC_PREREQ): ...this new macro.

>(I see you didn't pick up on my features.h idea.  That's OK; we can do
>it later if people like it)
>  
>

I wasn't completely sure what you meant, thought you might still be
trying to elicit comment from others, and wanted a quick fix for my
immediate problem.  I think I understand what features.h does in a glibc
context, but I'm unsure how that would fit into this pure/always_inline
issue, much less GNULIB.

Regards,

Derek

-- 
Derek R. Price
CVS Solutions Architect
Ximbiot 
v: +1 717.579.6168
f: +1 717.234.3125


Index: lib/regcomp.c
===
RCS file: /cvsroot/gnulib/gnulib/lib/regcomp.c,v
retrieving revision 1.18
diff -u -p -r1.18 regcomp.c
--- lib/regcomp.c   15 Sep 2005 19:14:23 -  1.18
+++ lib/regcomp.c   15 Sep 2005 20:41:15 -
@@ -17,19 +17,6 @@
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
 
-#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
-
 static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
  Idx length, reg_syntax_t syntax);
 static void re_compile_fastmap_iter (regex_t *bufp,
Index: lib/regexec.c
===
RCS file: /cvsroot/gnulib/gnulib/lib/regexec.c,v
retrieving revision 1.19
diff -u -p -r1.19 regexec.c
--- lib/regexec.c   15 Sep 2005 19:14:23 -  1.19
+++ lib/regexec.c   15 Sep 2005 20:41:16 -
@@ -17,19 +17,6 @@
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
 
-#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
-
 static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
 Idx n) internal_function;
 static void match_ctx_clean (re_match_context_t *mctx) internal_function;
Index: lib/regex_internal.c
===
RCS file: /cvsroot/gnulib/gnulib/lib/regex_internal.c,v
retrieving revision 1.18
diff -u -p -r1.18 regex_internal.c
--- lib/regex_internal.c15 Sep 2005 19:14:23 -  1.18
+++ lib/regex_internal.c15 Sep 2005 20:41:16 -
@@ -17,19 +17,6 @@
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
 
-#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, 0)
-# define pure
-#endif
-
 static void re_string_construct_common (const char *str, Idx len,
re_string_t *pstr,
REG_TRANSLATE_TYPE trans, bool icase,
Index: lib/regex_internal.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/regex_internal.h,v
retrieving revision 1.15
diff -u -p -r1.15 regex_internal.h
--- lib/regex_internal.h15 Sep 2005 19:14:23 -  1.15
+++ lib/regex_internal.h15 Sep 2005 20:41:16 -
@@ -84,7 +84,16 @@
 # define RE_ENABLE_I18N
 #endif
 
-#if __GNUC__ >= 3
+#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, 0)
 # define BE(expr, val) __builtin_expect (expr, val)
 #else
 # define BE(expr, val) (expr)
@@ -92,6 +101,10 @@
 # define pure
 #endi

Re: gnulib features.h?

2005-09-15 Thread Paul Eggert
Derek Price <[EMAIL PROTECTED]> writes:

> I've attached hte following for review since I took the liberty of
> replacing two #if __GNUC__ >= constructs in regex_internal.h with
> __GNUC_PREREQ calls.

Let's avoid that, since we want to minimize the differences from glibc.
Other than that, it looks good.  As I understand it, you want the
following change from a day ago.  This is pretty simple.

--- regex_internal.h.~1.14~ 2005-09-15 16:10:09.0 -0700
+++ regex_internal.h2005-09-15 16:13:16.0 -0700
@@ -84,11 +84,25 @@
 # 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.  */


___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib


Re: gnulib features.h?

2005-09-15 Thread Derek Price
Paul Eggert wrote:

>Other than that, it looks good.  As I understand it, you want the
>following change from a day ago.  This is pretty simple.
>  
>

Yes.  I've installed this.  I've not attached a patch since you
effectively sent it out in your last email.

2005-09-15  Derek Price  <[EMAIL PROTECTED]>
Paul Eggert  <[EMAIL PROTECTED]>

* regcomp.c, regexec.c, regex_internal.c: Back out previous
changes, consolidating in...
* regex_internal.h: ...this file.


Regards,

Derek

-- 
Derek R. Price
CVS Solutions Architect
Ximbiot 
v: +1 717.579.6168
f: +1 717.234.3125





___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib


Re: gnulib features.h? (was regex warnings)

2005-09-15 Thread Derek Price
Paul Eggert wrote:

>I'd fix it if I were you.  You can use the __GNUC_PREREQ macro of
>md5.h.
>

I've installed the attached patch.  It compiles cleanly on the offending
alpha-linux system.  I pretty-much cut & pasted the __GNUC_PREREQ macro
out of md5.h, as you suggested, and used it, except in regex_internal.h,
where I stumbled across a convenient #if __GNUC__ <= 3 switch already
being used to protect usage of inline, and used that.

2005-09-15  Derek Price  <[EMAIL PROTECTED]>
 
   * regex_internal.h: Blank `pure' for GNUC < 3.
   * regex_internal.c: Ditto, using this...
   (__GNUC_PREREQ): ...new macro.
   * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using...
   (__GNUC_PREREQ): ...this new macro.

Regards,

Derek

-- 
Derek R. Price
CVS Solutions Architect
Ximbiot 
v: +1 717.579.6168
f: +1 717.234.3125


Index: lib/regcomp.c
===
RCS file: /cvsroot/gnulib/gnulib/lib/regcomp.c,v
retrieving revision 1.17
diff -u -p -r1.17 regcomp.c
--- lib/regcomp.c   6 Sep 2005 07:36:48 -   1.17
+++ lib/regcomp.c   15 Sep 2005 19:08:52 -
@@ -17,6 +17,19 @@
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
 
+#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
+
 static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
  Idx length, reg_syntax_t syntax);
 static void re_compile_fastmap_iter (regex_t *bufp,
Index: lib/regexec.c
===
RCS file: /cvsroot/gnulib/gnulib/lib/regexec.c,v
retrieving revision 1.18
diff -u -p -r1.18 regexec.c
--- lib/regexec.c   6 Sep 2005 07:36:48 -   1.18
+++ lib/regexec.c   15 Sep 2005 19:08:52 -
@@ -17,6 +17,19 @@
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
 
+#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
+
 static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
 Idx n) internal_function;
 static void match_ctx_clean (re_match_context_t *mctx) internal_function;
Index: lib/regex_internal.c
===
RCS file: /cvsroot/gnulib/gnulib/lib/regex_internal.c,v
retrieving revision 1.17
diff -u -p -r1.17 regex_internal.c
--- lib/regex_internal.c6 Sep 2005 07:36:48 -   1.17
+++ lib/regex_internal.c15 Sep 2005 19:08:53 -
@@ -17,6 +17,19 @@
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
 
+#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, 0)
+# define pure
+#endif
+
 static void re_string_construct_common (const char *str, Idx len,
re_string_t *pstr,
REG_TRANSLATE_TYPE trans, bool icase,
Index: lib/regex_internal.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/regex_internal.h,v
retrieving revision 1.14
diff -u -p -r1.14 regex_internal.h
--- lib/regex_internal.h6 Sep 2005 17:50:47 -   1.14
+++ lib/regex_internal.h15 Sep 2005 19:08:53 -
@@ -89,6 +89,7 @@
 #else
 # define BE(expr, val) (expr)
 # define inline
+# define pure
 #endif
 
 /* Number of single byte character.  */
___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib


Re: gnulib features.h? (was regex warnings)

2005-09-15 Thread Derek Price
Paul Eggert wrote:

>I'd fix it if I were you.  You can use the __GNUC_PREREQ macro of
>md5.h.
>  
>

I know I've already installed this fix but, for future reference, is
there a simple reference I could use to find what version of GCC an
attribute first appeared in?  Something easier than fumbling through the
CVS history, that is.  :)

Thanks,

Derek

-- 
Derek R. Price
CVS Solutions Architect
Ximbiot 
v: +1 717.579.6168
f: +1 717.234.3125





___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib