On 2/16/21 10:42 AM, Thomas Shields wrote:
3, The 1st time is via “libc-config.h" in “regex.c”, the 2nd time is via "libc-config.h” via “dynarray.h” via “regex_internal.h”
libc-config.h is supposed to be included only once, and that 2nd time is a bug. Thanks for reporting it. I attempted to work around it by installing the attached patch into Gnulib; please give it a try.
From 4b5bc7fdd55da390f486bafa1e91ba93dd8d887f Mon Sep 17 00:00:00 2001 From: Paul Eggert <egg...@cs.ucla.edu> Date: Tue, 16 Feb 2021 11:41:19 -0800 Subject: [PATCH] Port better to macOS Mojave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem reported by Tom Shields in: https://lists.gnu.org/r/bug-gnulib/2021-02/msg00064.html * config/srclist.txt: Comment out dynarray_finalize.c. * lib/dynarray.h (__libc_dynarray_at_failure): Don’t include libc-config.h here, as that’s the includer’s responsibility. * lib/malloc/dynarray_at_failure.c: * lib/malloc/dynarray_emplace_enlarge.c: * lib/malloc/dynarray_finalize.c: * lib/malloc/dynarray_resize.c: * lib/malloc/dynarray_resize_clear.c: If _LIBC is not defined, include libc-config.h. --- ChangeLog | 15 +++++++++++++++ config/srclist.txt | 2 +- lib/dynarray.h | 2 -- lib/malloc/dynarray_at_failure.c | 4 ++++ lib/malloc/dynarray_emplace_enlarge.c | 4 ++++ lib/malloc/dynarray_finalize.c | 4 ++++ lib/malloc/dynarray_resize.c | 4 ++++ lib/malloc/dynarray_resize_clear.c | 4 ++++ 8 files changed, 36 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 594775509..000690dd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2021-02-16 Paul Eggert <egg...@cs.ucla.edu> + + Port better to macOS Mojave + Problem reported by Tom Shields in: + https://lists.gnu.org/r/bug-gnulib/2021-02/msg00064.html + * config/srclist.txt: Comment out dynarray_finalize.c. + * lib/dynarray.h (__libc_dynarray_at_failure): Don’t include + libc-config.h here, as that’s the includer’s responsibility. + * lib/malloc/dynarray_at_failure.c: + * lib/malloc/dynarray_emplace_enlarge.c: + * lib/malloc/dynarray_finalize.c: + * lib/malloc/dynarray_resize.c: + * lib/malloc/dynarray_resize_clear.c: + If _LIBC is not defined, include libc-config.h. + 2021-02-15 Bruno Haible <br...@clisp.org> linked-list test: Add test for SIGNAL_SAFE_LIST. (It currently fails.) diff --git a/config/srclist.txt b/config/srclist.txt index d669fd8f0..a55c95f3d 100644 --- a/config/srclist.txt +++ b/config/srclist.txt @@ -55,7 +55,7 @@ $LIBCSRC include/idx.h lib #$LIBCSRC malloc/dynarray.h lib/malloc #$LIBCSRC malloc/dynarray_at_failure.c lib/malloc #$LIBCSRC malloc/dynarray_emplace_enlarge.c lib/malloc -$LIBCSRC malloc/dynarray_finalize.c lib/malloc +#$LIBCSRC malloc/dynarray_finalize.c lib/malloc #$LIBCSRC malloc/dynarray_resize.c lib/malloc #$LIBCSRC malloc/dynarray_resize_clear.c lib/malloc $LIBCSRC include/scratch_buffer.h lib/malloc diff --git a/lib/dynarray.h b/lib/dynarray.h index 6da3e87e5..37053d0fa 100644 --- a/lib/dynarray.h +++ b/lib/dynarray.h @@ -19,8 +19,6 @@ #ifndef _GL_DYNARRAY_H #define _GL_DYNARRAY_H -#include <libc-config.h> - #define __libc_dynarray_at_failure gl_dynarray_at_failure #define __libc_dynarray_emplace_enlarge gl_dynarray_emplace_enlarge #define __libc_dynarray_finalize gl_dynarray_finalize diff --git a/lib/malloc/dynarray_at_failure.c b/lib/malloc/dynarray_at_failure.c index 0fa12c7cd..4f840db7c 100644 --- a/lib/malloc/dynarray_at_failure.c +++ b/lib/malloc/dynarray_at_failure.c @@ -16,6 +16,10 @@ License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ +#ifndef _LIBC +# include <libc-config.h> +#endif + #include <dynarray.h> #include <stdio.h> #include <stdlib.h> diff --git a/lib/malloc/dynarray_emplace_enlarge.c b/lib/malloc/dynarray_emplace_enlarge.c index ddfe306fc..0f8baf94a 100644 --- a/lib/malloc/dynarray_emplace_enlarge.c +++ b/lib/malloc/dynarray_emplace_enlarge.c @@ -16,6 +16,10 @@ License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ +#ifndef _LIBC +# include <libc-config.h> +#endif + #include <dynarray.h> #include <errno.h> #include <intprops.h> diff --git a/lib/malloc/dynarray_finalize.c b/lib/malloc/dynarray_finalize.c index 8ec6ad2bc..c33da4138 100644 --- a/lib/malloc/dynarray_finalize.c +++ b/lib/malloc/dynarray_finalize.c @@ -16,6 +16,10 @@ License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ +#ifndef _LIBC +# include <libc-config.h> +#endif + #include <dynarray.h> #include <stdlib.h> #include <string.h> diff --git a/lib/malloc/dynarray_resize.c b/lib/malloc/dynarray_resize.c index 5c60927f3..5a57166a8 100644 --- a/lib/malloc/dynarray_resize.c +++ b/lib/malloc/dynarray_resize.c @@ -16,6 +16,10 @@ License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ +#ifndef _LIBC +# include <libc-config.h> +#endif + #include <dynarray.h> #include <errno.h> #include <intprops.h> diff --git a/lib/malloc/dynarray_resize_clear.c b/lib/malloc/dynarray_resize_clear.c index e893d1d58..9c43b00c3 100644 --- a/lib/malloc/dynarray_resize_clear.c +++ b/lib/malloc/dynarray_resize_clear.c @@ -16,6 +16,10 @@ License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ +#ifndef _LIBC +# include <libc-config.h> +#endif + #include <dynarray.h> #include <string.h> -- 2.27.0