From: Paul Eggert Date: Mon, 14 Apr 2025 21:43:02 +0000 (-0700) Subject: regex: don’t check RE_SYNTAX_EMACS X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=6ff0345dd56403f8a7953602b10c914f81f80d20;p=gnulib.git regex: don’t check RE_SYNTAX_EMACS * m4/regex.m4 (gl_REGEX): Do not check RE_SYNTAX_EMACS’s value. Suggested by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2025-04/msg00098.html --- diff --git a/ChangeLog b/ChangeLog index 634f5b089e..1d4a399379 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-04-14 Paul Eggert + + regex: don’t check RE_SYNTAX_EMACS + * m4/regex.m4 (gl_REGEX): Do not check RE_SYNTAX_EMACS’s value. + Suggested by Bruno Haible in: + https://lists.gnu.org/r/bug-gnulib/2025-04/msg00098.html + 2025-04-14 Bruno Haible c32is*, c32to* tests: Avoid test failures on macOS 15.4. diff --git a/doc/posix-headers/regex.texi b/doc/posix-headers/regex.texi index b54c243060..403088c6fc 100644 --- a/doc/posix-headers/regex.texi +++ b/doc/posix-headers/regex.texi @@ -11,6 +11,19 @@ Portability problems fixed by Gnulib: @item This header file is missing on some platforms: mingw, MSVC 14. + +@item +On some systems that have this header file, +GNU extensions like @code{re_set_syntax} and @code{RE_SYNTAX_EMACS} +are not declared or supported: +FreeBSD 14.2, OpenBSD 7.6, NetBSD 10.1, macOS 15, +Minix 3.3.0, AIX 7.3, HP-UX 11, Solaris 11.4. + +@item +On some systems that support GNU extensions, @code{RE_SYNTAX_EMACS} is 0 +even though it should be @code{(RE_CHAR_CLASSES | RE_INTERVALS)} +to be compatible with Emacs 21 (2001) and later: +glibc 2.41, Cygwin 2.6.x. @end itemize Portability problems not fixed by Gnulib: diff --git a/m4/regex.m4 b/m4/regex.m4 index 52ce5c3b37..49a8059f61 100644 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -1,5 +1,5 @@ # regex.m4 -# serial 80 +# serial 81 dnl Copyright (C) 1996-2001, 2003-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -54,9 +54,10 @@ AC_DEFUN([gl_REGEX], static void sigabrt_no_core (int sig) { raise (SIGTERM); } #endif - #if !RE_SYNTAX_EMACS - # error "RE_SYNTAX_EMACS does not match Emacs behavior" - #endif + /* There is no need to check whether RE_SYNTAX_EMACS is + (RE_CHAR_CLASSES | RE_INTERVALS), corresponding to + Emacs 21 (2001) and later, because Gnulib's lib/regex.h + is always used and has this value. */ ]], [[int result = 0; static struct re_pattern_buffer regex;