[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] regex-tests: new module
From: |
Paul Eggert |
Subject: |
Re: [PATCH 2/2] regex-tests: new module |
Date: |
Sun, 03 Feb 2013 09:21:41 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 |
Thanks for the bug report. I pushed the following two more patches.
---
ChangeLog | 8 ++++++++
modules/regex-tests | 1 +
2 files changed, 9 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index bde8f8f..d369fb3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-02-03 Paul Eggert <address@hidden>
+
+ regex-tests: fix link errors on older Solaris
+ These need to link with @LIBINTL@ to get libintl_gettext.
+ Problem reported by Tom G. Christensen in
+ <http://lists.gnu.org/archive/html/bug-gnulib/2013-02/msg00003.html>.
+ * modules/regex-tests (test_regex_LDADD): New macro.
+
2013-01-31 Paul Eggert <address@hidden>
regex-tests: new module
diff --git a/modules/regex-tests b/modules/regex-tests
index 9199d3e..eb1b1d3 100644
--- a/modules/regex-tests
+++ b/modules/regex-tests
@@ -9,3 +9,4 @@ configure.ac:
Makefile.am:
TESTS += test-regex
check_PROGRAMS += test-regex
+test_regex_LDADD = $(LDADD) @LIBINTL@
--
1.7.11.7
---
ChangeLog | 9 +++++++++
m4/regex.m4 | 19 ++++++++++---------
tests/test-regex.c | 2 +-
3 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d369fb3..688b7e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2013-02-03 Paul Eggert <address@hidden>
+ regex-tests, regex: fix bug: memset undeclared
+ * tests/test-regex.c: Don't include regex.h twice. Include
+ string.h, to declare memset. Christensen's report also mentioned
+ this issue.
+ * m4/regex.m4 (gl_REGEX): Keep test program more in sync with
+ test-regex.c, to avoid future problems like this. Remove
+ AC_INCLUDES_DEFAULT. Include <string.h>. Don't include <regex.h>
+ twice.
+
regex-tests: fix link errors on older Solaris
These need to link with @LIBINTL@ to get libintl_gettext.
Problem reported by Tom G. Christensen in
diff --git a/m4/regex.m4 b/m4/regex.m4
index 958c663..ae89e31 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -32,15 +32,16 @@ AC_DEFUN([gl_REGEX],
[gl_cv_func_re_compile_pattern_working],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
- [AC_INCLUDES_DEFAULT[
- #include <locale.h>
- #include <limits.h>
- #include <regex.h>
- #if HAVE_ALARM
- # include <unistd.h>
- # include <signal.h>
- #endif
- ]],
+ [[#include <regex.h>
+
+ #include <locale.h>
+ #include <limits.h>
+ #include <string.h>
+ #if HAVE_ALARM
+ # include <unistd.h>
+ # include <signal.h>
+ #endif
+ ]],
[[int result = 0;
static struct re_pattern_buffer regex;
unsigned char folded_chars[UCHAR_MAX + 1];
diff --git a/tests/test-regex.c b/tests/test-regex.c
index e30a1e1..2488cee 100644
--- a/tests/test-regex.c
+++ b/tests/test-regex.c
@@ -20,7 +20,7 @@
#include <locale.h>
#include <limits.h>
-#include <regex.h>
+#include <string.h>
#if HAVE_ALARM
# include <unistd.h>
# include <signal.h>
--
1.7.11.7