Reuben Thomas wrote: > breaks on Darwin: > > In file included from glob.c:81: > In file included from ./scratch_buffer.h:4: > In file included from ./libc-config.h:33: > ../config.h:927:9: warning: 'fnmatch' macro redefined [-Wmacro-redefined] > #define fnmatch posix_fnmatch > ^ > ./fnmatch.h:554:12: note: previous definition is here > # define fnmatch rpl_fnmatch > ^
"Breaks" is a strong word, when it's just a warning. But you're right, it's better to fix it. The first definition, in config.h, is an old-style definition, from the time before we had the *.in.h idioms. Since no one really cares whether the replacement function is called 'rpl_fnmatch', 'posix_fnmatch', or 'gnu_fnmatch' (the only important thing is that it is not called 'fnmatch'), the fix is to just remove that definition: 2018-08-18 Bruno Haible <[email protected]> fnmatch: Avoid conflicting macro definitions of 'fnmatch'. Reported by Reuben Thomas <[email protected]> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00108.html>. * m4/fnmatch.m4 (gl_PREREQ_FNMATCH): Don't define 'fnmatch' as a macro in config.h. diff --git a/m4/fnmatch.m4 b/m4/fnmatch.m4 index 9414514..f05f845 100644 --- a/m4/fnmatch.m4 +++ b/m4/fnmatch.m4 @@ -1,4 +1,4 @@ -# Check for fnmatch - serial 11. -*- coding: utf-8 -*- +# Check for fnmatch - serial 12. -*- coding: utf-8 -*- # Copyright (C) 2000-2007, 2009-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -140,11 +140,6 @@ AC_DEFUN([gl_FUNC_FNMATCH_GNU], AC_DEFUN([gl_PREREQ_FNMATCH], [ - dnl We must choose a different name for our function, since on ELF systems - dnl a broken fnmatch() in libc.so would override our fnmatch() if it is - dnl compiled into a shared library. - AC_DEFINE_UNQUOTED([fnmatch], [${gl_fnmatch_required_lowercase}_fnmatch], - [Define to a replacement function name for fnmatch().]) dnl Prerequisites of lib/fnmatch.c. AC_REQUIRE([AC_TYPE_MBSTATE_T]) AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
