From 6668cfa30c1b2f636b2db12327a6e87fe613e534 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 3 Feb 2013 09:19:06 -0800 Subject: [PATCH] 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 . Don't include twice. --- 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 d369fb3ac..688b7e062 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2013-02-03 Paul Eggert + 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 . Don't include + 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 958c66374..ae89e3113 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 - #include - #include - #if HAVE_ALARM - # include - # include - #endif - ]], + [[#include + + #include + #include + #include + #if HAVE_ALARM + # include + # include + #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 e30a1e1b9..2488cee21 100644 --- a/tests/test-regex.c +++ b/tests/test-regex.c @@ -20,7 +20,7 @@ #include #include -#include +#include #if HAVE_ALARM # include # include -- 2.11.0