Paul Eggert wrote: > >> - Will they change RE_BACKSLASH_ESCAPE_IN_LISTS from > >> ((unsigned long int) 1) > >> to > >> (1UL) > >> in order to make the RE_* values usable in preprocessor expressions? > > > > No; I followed up with a later patch to remove that assumption. > > Oops, sorry, I misunderstood your comment. You're right, we need a patch > to do that. I just installed the attached .
You attached this patch in Gnulib, but not also in glibc. If we don't want to make assumptions about whether glibc makes the same change, how about this patch? diff --git a/m4/regex.m4 b/m4/regex.m4 index 52ce5c3b37..508352ab43 100644 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -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 + /* Check whether RE_SYNTAX_EMACS matches Emacs behavior. + Note that in many glibc versions, the RE_* macros cannot + be used in preprocessor expressions. */ + typedef int emacs_check[RE_SYNTAX_EMACS ? 1 : -1]; ]], [[int result = 0; static struct re_pattern_buffer regex;