This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFA 2/3] libctf: Add configure check for asprintf (for MinGW)
- From: Nick Alcock <nick dot alcock at oracle dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: binutils at sourceware dot org, Nick Alcock <nick dot alcock at oracle dot com>, Eli Zaretskii <eliz at gnu dot org>
- Date: Fri, 03 Jan 2020 15:50:39 +0000
- Subject: Re: [RFA 2/3] libctf: Add configure check for asprintf (for MinGW)
- References: <8336di50ij.fsf@gnu.org> <20200102134322.1646-1-brobecker@adacore.com> <20200102134322.1646-3-brobecker@adacore.com>
On 2 Jan 2020, Joel Brobecker told this:
> From: Eli Zaretskii <eliz@gnu.org>
>
> This commit fixes a compilation warning when compiling libctf
> on MinGW:
>
> libctf/ctf-dump.c:118:8: warning: implicit declaration of function
> 'asprintf'; did you mean 'vasprintf'? [-Wimplicit-function-declaration]
>
> if (asprintf (&bit, " %lx: [slice 0x%x:0x%x]",
> ^~~~~~~~
> vasprintf
>
> MinGW doesn't provide that function, so we depend on the one provided
> by libiberty. However, the declaration is guarded by HAVE_DECL_ASPRINTF,
> which we do not have in libctf's config.h.
>
> libctf/ChangeLog:
>
> PR binutils/25155:
> * configure.ac: Add AC_CHECK_DECLS([asprintf]).
> * configure, config.h.in: Regenerate.
Looks good.