Bruno Haible <bruno <at> clisp.org> writes: > > * modules/obstack-printf-posix (Depends-on): Add obstack-printf. > > This is not needed. The modules 'obstack-printf-posix' and 'obstack-printf' > are two modules that use the same source code but different .m4 macros. > There is no need for running gl_FUNC_OBSTACK_PRINTF when we are also running > gl_FUNC_OBSTACK_PRINTF_POSIX.
But something IS needed. If you use gnulib-tool, but not --with-tests, then nothing calls gl_FUNC_OBSTACK_PRINTF, which means that HAVE_DECL_OBSTACK_PRINTF is never set to 0, which causes compilation failures on non-glibc platforms because obstack_printf is no longer declared in our replacement <stdio.h>. I suppose the alternative is this (untested; but I can use it instead of the first if it passes testing): From: Eric Blake <e...@byu.net> Date: Mon, 8 Feb 2010 15:07:14 -0700 Subject: [PATCH] obstack-printf-posix: ensure declaration The replacement <stdio.h> was failing to declare obstack_printf if obstack-printf-posix was used in isolation without unit tests. * m4/obstack-printf.m4 (gl_FUNC_OBSTACK_PRINTF): Move declaration check... (gl_REPLACE_OBSTACK_PRINTF): ...here. Analysis aided by Bruno Haible. Signed-off-by: Eric Blake <e...@byu.net> --- ChangeLog | 8 ++++++++ m4/obstack-printf.m4 | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c3d813..ab2834a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-02-08 Eric Blake <e...@byu.net> + + obstack-printf-posix: ensure declaration + * m4/obstack-printf.m4 (gl_FUNC_OBSTACK_PRINTF): Move declaration + check... + (gl_REPLACE_OBSTACK_PRINTF): ...here. + Analysis aided by Bruno Haible. + 2009-11-17 Eric Blake <e...@byu.net> manywarnings: add more warnings diff --git a/m4/obstack-printf.m4 b/m4/obstack-printf.m4 index ae2e5d9..5be4b42 100644 --- a/m4/obstack-printf.m4 +++ b/m4/obstack-printf.m4 @@ -1,4 +1,4 @@ -# obstack-printf.m4 serial 2 +# obstack-printf.m4 serial 3 dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,11 +18,6 @@ AC_DEFUN([gl_FUNC_OBSTACK_PRINTF], if test $ac_cv_func_obstack_printf = no ; then gl_REPLACE_OBSTACK_PRINTF fi - - AC_CHECK_DECLS_ONCE([obstack_printf]) - if test $ac_cv_have_decl_obstack_printf = no; then - HAVE_DECL_OBSTACK_PRINTF=0 - fi ]) AC_DEFUN([gl_REPLACE_OBSTACK_PRINTF], @@ -32,4 +27,9 @@ AC_DEFUN([gl_REPLACE_OBSTACK_PRINTF], if test $ac_cv_func_obstack_printf = yes; then REPLACE_OBSTACK_PRINTF=1 fi + + AC_CHECK_DECLS_ONCE([obstack_printf]) + if test $ac_cv_have_decl_obstack_printf = no; then + HAVE_DECL_OBSTACK_PRINTF=0 + fi ]) -- 1.6.6.1