Simon Josefsson wrote:
> I haven't been paying attention to the *printf discussions, but
> looking at current CVS, shouldn't the vasprintf module use stdio.h for
> the prototypes?
Yes, you're right. Since, as Paul said, gnulib not only attempts to mimic
POSIX APIs but also glibc APIs, and glibc declares vasprintf() and asprintf()
in <stdio.h>, gnulib should do the same.
> 2007-03-12 Simon Josefsson <[EMAIL PROTECTED]>
>
> * modules/vasprintf: Depend on stdio for prototypes, and remove
> vasprintf.h.
>
> * lib/stdio_.h: Declare asprintf and vasprintf, from vasprintf.h.
>
> * lib/asprintf.c: Use stdio.h for prototypes.
> * lib/vasprintf.c: Ditto.
>
> * lib/vasprintf.h: File removed.
Correct but a few things are missing:
- While moving the declarations to <stdio.h>, you dropped the specification
comments. They are essential.
- While moving the declarations to <stdio.h>, you dropped the
#if !HAVE_VASPRINTF. When an implementation has the functions and they
work fine, we don't want to risk a compilation error due to redeclaration
of system functions. The declarations should be skipped in this case.
- The '# if REPLACE_VASPRINTF' needs to be turned into a test of an
AC_SUBSTed variable, so that the generated stdio.h doesn't need a
config.h.
- After you settled on the changes to lib/stdio_.h, modules/stdio and
m4/stdio_h.m4 need to be updated accordingly.
- Also update the callers:
fgrep '"vasprintf.h"' lib/*.c tests/*.c
shows a few places to update.
Bruno