[PATCH] libiberty: Only declare vasprintf if it was checked for

Michael Forney mforney@mforney.org
Tue Apr 23 08:18:00 GMT 2019

This matches how the the rest of the libc functions are declared and
prevents a potential conflict with the system declaration when libiberty.h
is included from a directory that did not check for vasprintf, but it is
available. It also corresponds to a similar previous change for asprintf

2019-04-22  Michael Forney  <mforney@mforney.org>

	* libiberty.h (vasprintf): Don't declare if HAVE_DECL_VASPRINTF
	is not defined.

 include/libiberty.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/libiberty.h b/include/libiberty.h
index 57476135026..e11aa97f0ba 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -649,7 +649,7 @@ extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
 extern char *xasprintf (const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_PRINTF_1;
 /* Like vsprintf but provides a pointer to malloc'd storage, which
    must be freed by the caller.  */

More information about the Gcc-patches mailing list