]> Savannah Git Hosting - gnulib.git/commitdiff
regex: don’t check RE_SYNTAX_EMACS
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 14 Apr 2025 21:43:02 +0000 (14:43 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 14 Apr 2025 21:45:13 +0000 (14:45 -0700)
* 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

ChangeLog
doc/posix-headers/regex.texi
m4/regex.m4

index 634f5b089eb71d93353dadf76273ee4694a1b598..1d4a3993791bf1144837e543dd27858f6fcc2266 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-04-14  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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  <bruno@clisp.org>
 
        c32is*, c32to* tests: Avoid test failures on macOS 15.4.
index b54c2430605d32dda409a8898b5cb03076daa8e5..403088c6fc57e81bb618138424b6cdee152d32a4 100644 (file)
@@ -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:
index 52ce5c3b3713b08137e5ce77d527268ce15bb9c5..49a8059f618bae2349cf02ebe7887ed3cb075992 100644 (file)
@@ -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;